ExtJs grid行 右键菜单(转载)

 grid.on("rowcontextmenu", function (grid, rowIndex, e) {
        e.preventDefault();
        if (rowIndex < 0) { return; }
        var treeMenu = new Ext.menu.Menu
        ([
            {
                xtype: "",
                text: "详细",
                iconCls: 'context-dog',
                pressed: false,
                handler: function () {
                    //获得行数据  
                    var record = grid.getStore().getAt(rowIndex);
                    //open_receive_detailWindow(record.data.smsIndex);
                    alert(record.data.company);
                    //record.data.taskId  
                }
            }, {
                xtype: "",
                text: "删除",
                iconCls: 'context-cat',
                pressed: false,
                handler: function () {
                    //获得行数据  
                    var record = grid.getStore().getAt(rowIndex);
                    alert(record.data.company);
                }
            }
        ]);
        treeMenu.showAt(e.getXY());
    });
posted @ 2010-06-18 10:00  3.mu  阅读(1031)  评论(0编辑  收藏  举报