• [King.yue]Grid列选中JS控制按钮状态


    Grid列选中一行某些按钮启用

    例:gridId(Grid   ID)

      btnEditId(编辑按钮ID)

      btnDeleteId(删除按钮ID)

    JS:

    var setButtonStatus = function (gridId, btnEditId, btnDeleteId) {
    var gridView = Ext.getCmp(gridId).getSelectionModel(); //获取Grid列选中状态
    if (gridView.hasSelection()) {
    if (typeof (Ext.getCmp(btnEditId)) != 'undefined')    //判断控件状态
    Ext.getCmp(btnEditId).setDisabled(false);        //设置控件显示
    if (typeof (Ext.getCmp(btnDeleteId)) != 'undefined')
    Ext.getCmp(btnDeleteId).setDisabled(false);
    }
    else {
    if (typeof (Ext.getCmp(btnEditId)) != 'undefined')
    Ext.getCmp(btnEditId).setDisabled(true);
    if (typeof (Ext.getCmp(btnDeleteId)) != 'undefined')
    Ext.getCmp(btnDeleteId).setDisabled(true);
    }
    }

    调用:

    item.Add(Html.Y().Grid(Model.GridId, Model.StoreId)
    .Listeners(l =>
    {
    l.SelectionChange.Handler += string.Format(@"setButtonStatus('{0}','{1}','{2}')"
    , Model.GridId, vm.BTN_HBOOK_ITEM_EDIT, vm.BTN_HBOOK_ITEM_DELETE);
    })

  • 相关阅读:
    BZOJ 4710: [Jsoi2011]分特产
    P4859 已经没有什么好害怕的了
    BZOJ 2839 集合计数
    P1450 [HAOI2008]硬币购物
    P3440 [POI2006]SZK-Schools
    P4177 [CEOI2008]order
    对于最小割的进一步理解
    P2774 方格取数问题
    JAVA网络编程TCP通信
    JAVA多线程及补充
  • 原文地址:https://www.cnblogs.com/teamate/p/3682701.html
Copyright © 2020-2023  润新知