EasyUI Forum
September 20, 2025, 09:03:04 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Fire event when click text editor  (Read 8277 times)
finzaiko
Newbie
*
Posts: 44


View Profile
« on: July 18, 2014, 09:45:16 PM »

How fire event when I click texteditor after I add new row or when I editing the row (double click the row), something like this :


 
Code:
onAdd: function(index, row) { // or onEdit
                var edCode = $(this).datagrid('getEditor', {index: index, field: 'code'});
                var edItemDesc = $(this).datagrid('getEditor', {index: index, field: 'combined'});
                $(edCode.target).attr('disabled', 'disabled');
                $(edItemDesc.target).attr('disabled', 'disabled');
               
                $(edCode.target).click(function(){{
                        alert('show dialog box lookup');
                });
               
            },

I try like this :
Code:
onDblClickCell: function(rowIndex, field, value) {
                if (field === 'code' || field === 'item_desc') {
                    openDlgFindDescItem();
                }
            },

but not work after row editable in edatagrid

Thanks for help highly appreciated.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 18, 2014, 11:30:34 PM »

When a row is in edit mode, single clicking another row will put that row into edit mode. The editors will be generated immediately and the double click event will be ignored since the second clicking does not applied to the row but editor. To avoid this issue, please call 'saveRow' method to save the editing row before double clicking a row.
Code:
$('#tt').edatagrid({
onDblClickCell:function(index,field){
// ...
},
onClickCell:function(){
$(this).edatagrid('saveRow');
}
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!