如何使用视图:“组合”来编辑webix选择字段?

时间:2016-07-19 13:59:05

标签: javascript webix

这是我的js档案

如何使用视图:“combo”来编辑webix选择字段?使用视图:“选择”不是一个选项。

rows: [          {
                    borderless: true,
                    css: "font_bold",
                    height: 35,
                    template: displayContent
                  },
                  {
                    view: "combo",
                    id: "myId",
                    tooltip: somevalue,
                    value: someid,
                    options: contactListOptions,
                    on: {
                     ------
                  }

2 个答案:

答案 0 :(得分:0)

their forum

提到了类似的问题

我已经测试了一下 - 看起来它仍然以相同的方式运行,因此以下解决方法是相关的:

/* if readonly set to true */
  suggest:{        
    on:{  
      onBeforeShow:function(){
        var parent = $$(this.config.master);
        if (parent.config.readonly)
          return false; 
      }
    },    
    body:{ 
      on:{
        onBeforeSelect:function(){
          var parent = $$(this.getParentView().config.master);          
          if (parent.config.readonly)               
            return false;
        }
      }
    },
    data:combo_data,
  }

答案 1 :(得分:0)

此外,您可以使用richselect编辑器,其行为与组合相同,但不允许编辑操作。

 {
   view: "richselect",
   id: "myId",
   tooltip: somevalue,
   value: someid,
   options: contactListOptions,
   on: { /**/ }
 }