EasyUI Forum
June 28, 2024, 07:10:52 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: Add editor properties to 'onBeginEdit'.  (Read 3247 times)
officecode
Jr. Member
**
Posts: 69


View Profile Email
« on: December 06, 2018, 10:25:49 PM »

Hello,
The following code just adds an onChange property to the editor, which works fine, but the console prompts an error.
Is there any problem with this code?

Code:
onBeginEdit:function(index,row){
var ed = $(this).datagrid('getEditor', {
                index: index,
                field: 'sl'
        });
        var opt = $(ed.target)[ed.type]('options');
opt.onChange = function(value){
$('#test').datagrid('updateRow',{
        index: index,
                    row:{je:'888'}
})
};
$(ed.target)[ed.type](opt)

Logged
jarry
Administrator
Hero Member
*****
Posts: 2268


View Profile Email
« Reply #1 on: December 07, 2018, 04:40:18 PM »

Please make sure if your 's1' field has been set the 'textbox' editor. Calling 'updateRow' will abort the editing behaviour, so please call 'endEdit' or 'cancelEdit' method to stop editing the row before calling the 'updateRow' method.
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!