Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在extjs行编辑插件中更改行_Extjs_Extjs4_Extjs4.2 - Fatal编程技术网

在extjs行编辑插件中更改行

在extjs行编辑插件中更改行,extjs,extjs4,extjs4.2,Extjs,Extjs4,Extjs4.2,我使用extjs4.2.2版本 我创建行编辑 rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit : 2, clicksToMoveEditor : 1, autoCancel : false, errorSummary : false, listeners : { edit : function(edito

我使用extjs4.2.2版本

我创建行编辑

rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
        clicksToEdit : 2,
        clicksToMoveEditor : 1,
        autoCancel : false,
        errorSummary : false,
        listeners : {
            edit : function(editor, e, opt) {
                // ... some code ...
            }
        }
});
然后在面板上使用它:

tGrid = Ext.create('Ext.tree.Panel', {
    title : 'title',
    rootVisible : false,
    store : tStore,
    plugins : [ rowEditing ],
    columns : this.defineColumns()
});

this.defineColumns = function() {
    return [ {
        text : 'smth',
        xtype : 'treecolumn',
        dataIndex : 'name',
        width : 300,
        editor : {}
    }];
};

所以,当我使用行编辑更改一些数据,然后更改行时,所有更改都会删除。未经允许,我想拒绝更改“编辑”下行的位置。或者至少使用行更改自动保存数据更改。找不到执行此操作的方法。

//配置OnGridCell单击控制器自动保存修改的行

init: function() {    
        this.control({    
        '#listingGrid' : {   
            cellclick : this.onGridCellClick  
        }  
    });  
}  

onGridCellClick: function() {  
// Autosave modified rows.  
var lModifiedRecords = YourApp.utils.CustomUtils.getGrid().getStore().getModifiedRecords();  
for (var i=0; i< lModifiedRecords.length; i++) {  
 var lModifiedRecord = lModifiedRecords[i].data;  
 var ajaxConfig = {url: '#{serviceUrl}', requestParams: lModifiedRecord};  
 ajaxWrapper(ajaxConfig);  
}

function ajaxWrapper(ajaxConfig) {  
  Ext.Ajax.request({  
        scope   : this,  
        url     : ajaxConfig.url,  
        ..  
        params  : ajaxConfig.requestParams,   
        success : function(response, opts) {  
                  .....  
                }  
}

不应该设置为false,因为代码中已经提供了该功能?它似乎在@matt中起作用,我希望autoCancel能起作用。但事实并非如此。可能是因为我使用Ext.tree.Panel而不是Ext.greed.Panel。我将添加有关tGrid配置的更多信息。添加tGrid的配置方式。