gpt4 book ai didi

extjs - 网格-按钮单击处理程序

转载 作者:行者123 更新时间:2023-12-02 03:58:58 28 4
gpt4 key购买 nike

在我的Grid中,当我单击“操作”按钮(下面的代码中显示的“删除和编辑”按钮)时,我需要弹出一个窗口,而不用警告消息提醒用户;

在下面的代码中,我正在使用HANDLER handler: buttonClicked,并尝试访问我从下面的其他函数单击的行值

buttonClicked :function (){...}
  • 我不知道该怎么做,有人可以帮我吗?
  • 我可以访问单击的行并从Controller类显示其名称吗?


  • CODE SNIPET
    Ext.define('CountryAppTest.view.user.Gridview', {
    extend: 'Ext.grid.Panel',
    initComponent: function() {
    this.store = 'store';
    this.columns = [{
    xtype: 'ac',
    items: [{
    icon: 'lib/extjs/examples/restful/images/delete.png',
    handler: buttonClicked
    }]
    }, {
    text: "username",
    dataIndex: 'username'
    }];
    this.viewConfig = {
    forceFit: true
    };
    this.callParent(arguments);
    },
    buttonClicked: function(grid, rowIndex, colIndex) {
    var rec = grid.getStore().getAt(rowIndex);
    Ext.Msg.alert("Info", "name " + rec.get('username'));
    }
    });

    最佳答案

    (grid, rowIndex, colIndex)参数添加到buttonClicked声明中。

    关于extjs - 网格-按钮单击处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11297378/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com