【问题标题】:Add custom button into jqGrid ColumnChooser dialog将自定义按钮添加到 jqGrid ColumnChooser 对话框中
【发布时间】:2015-12-18 08:57:06
【问题描述】:

我想在 ColumnChooser 对话框中添加自定义按钮并使其表现得像其他人一样。我试着得到类似this(Default button)

  _this.table.jqGrid("navButtonAdd", _this.pid, {
    caption: "",
    buttonicon: "icon",
    title: "Title",
    onClickButton: function() {
      return self.table.jqGrid("columnChooser", {
        done: function(perm) {
          if (perm) {   
            self.table.jqGrid("remapColumns", perm, true);
            return $(window).triggerHandler("resize.jqGrid");
          }
        },
        dialog_opts: {
          modal: true,
          resizable: false
        },
        msel_opts: {
          dividerLocation: 0.5
        },
        width: 460
      });

    }
  });

【问题讨论】:

    标签: javascript jquery button jqgrid column-chooser


    【解决方案1】:

    您可以通过以下方式执行此操作:

    onClickButton: function () {
        $(this).jqGrid("columnChooser", {
            dialog_opts: {
                buttons: {
                    Default: function () {
                        alert("Default button is clicked!");
                    }
                }
            }
        });
    }
    

    The corresponding demo 显示以下结果:

    【讨论】:

      猜你喜欢
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-23
      • 1970-01-01
      • 2013-08-23
      • 1970-01-01
      相关资源
      最近更新 更多