extjs RowEditor调用保存及取消事件的设置用法

extjs | 2019-09-13 10:02:39

在文档api Ext.grid.RowEditor中根本就没有任何关于,保存和取消按钮的设置。不知道保存和取消的事件,也不知道怎么设置显示名称。找了半天。

Ext.define('app.menu.MenuTreeGridView',{
        extend: 'Ext.tree.Panel',
        alias: ['widget.menuTreeGridView'],
        closable:true,
        rootVisible:false,
        columnLines:true,
        plugins:[{
                ptype:"rowediting",
                saveBtnText: '保存',
                cancelBtnText: "取消",
                listeners:{
                        edit:function( editor, context, eOpts ){
                                console.log(editor);
                        },
                        canceledit:function( editor, context, eOpts ){
                                console.log(editor);
                        }
                }
        }],
        tbar:[{
                text:"新增",
                icon:'images/icon/add.png'
        },{
                text:"修改",
                icon:'images/icon/update.png'
        },{
                text:"删除",
                icon:'images/icon/delete.png'
        }],
        columns: [{
                xtype: 'treecolumn',
                text: '菜单名称',
                sortable:false,
                dataIndex: 'text',
                width:200,
                editor: {allowBlank: false}
        },{
                text: '图标',
                width:200,
                dataIndex: 'icon',
                sortable: false,
                editor: {}
        },{
                text: '地址',
                width:250,
                sortable: false,
                dataIndex: 'uri',
                editor: {}
        },{
                text: '排序',
                width:60,
                sortable: false,
                dataIndex: 'sort',
                editor: {xtype:"numberfield"}
        }],
        store:{
                root:{id:0},
                defaultRootProperty:"data",
                fields: [{
                        name: 'id'
                },{
                        name: 'parentId'
                },{
                        name: 'text'
                },{
                        name: 'uri'
                },{
                        name: 'icon'
                },{
                        name: 'sort'
                }],
                proxy: {
                        type: 'ajax',
                        url:'menuAction/getChildrenMenu.action'
                }
        }
});


登录后即可回复 登录 | 注册
    
关注编程学问公众号