【问题标题】:Slickgrid: Is it possible to pass options to an editor?Slickgrid:是否可以将选项传递给编辑器?
【发布时间】:2013-08-26 19:20:17
【问题描述】:

例如:LongTextEditor 有固定的宽高:

$input = $("<TEXTAREA hidefocus rows=5 style='backround:white;width:250px;height:80px;border:0;outline:0'>")
      .appendTo($wrapper);

最好将其参数化,如下所示:

$input = $("<TEXTAREA hidefocus rows=5 style='backround:white;width:"+options.width+";height:"+options.height+";border:0;outline:0'>")
      .appendTo($wrapper);

【问题讨论】:

    标签: javascript slickgrid


    【解决方案1】:

    是的,您可以通过以下方式实现。

    将选项列表传递给列数组

    var columns = [
            { id: "Id", name: "NAME", field: "FIELD", options: YourList, editor: Slick.Editors.YourEditor,},
                  ];
    

    然后你可以在你的编辑器中访问它(编辑器的默认文件Slick.editors.js

     function YourEditor(args) {
         //Access columns list using "args.column.options"
     }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-13
      • 1970-01-01
      • 2018-04-17
      • 2019-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多