use*_*857 2 grid extjs4 celleditorlistener
我在extjs工作.我有gridview与grid cellediting插件as-
Ext.define('H.view.library.LibraryListView', {
extend: 'Ext.grid.Panel',
alias : 'widget.librarylistview',
id:'librarylistviewId',
store: 'LibraryFileStore',
requires:['RUI.view.campaign.ImageViewer'],
plugins:[
Ext.create('Ext.grid.plugin.CellEditing',{
clicksToEdit: 1,
listeners: {
'edit': function(editor,e) {
var me=this;
title = e.value;
id = e.record.get('id');
}
}
})
],
Run Code Online (Sandbox Code Playgroud)
我想在status = 0时禁用此编辑.那么根据条件,我需要做些什么来禁用和启用cellediting
您可以通过在网格上添加beforeEdit事件来禁用编辑 -
yourGrid.on('beforeedit',function(editor,e){
if(your condition){
return false;//this will disable the cell editing
}
});
Run Code Online (Sandbox Code Playgroud)
您可以获取有关beforeedit事件的更多信息以及可以从此函数的参数获取的不同值 -
http://docs.sencha.com/extjs/4.1.0/#!/api/Ext.grid.Panel-event-beforeedit
| 归档时间: |
|
| 查看次数: |
3791 次 |
| 最近记录: |