EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: officecode on December 06, 2018, 10:25:49 PM



Title: Add editor properties to 'onBeginEdit'.
Post by: officecode 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)



Title: Re: Add editor properties to 'onBeginEdit'.
Post by: jarry 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.