【问题标题】:Extjs modern toolkit 6.5.2 Triton binding Multiselect fieldExtjs 现代工具包 6.5.2 Triton 绑定多选字段
【发布时间】:2019-02-19 16:52:09
【问题描述】:

我正在尝试在现代工具包中模拟经典工具包中存在的 tagfield,我找到了两种方法:

https://github.com/facilitiesexchange/TagField/

ExtJs 6 Modern toolkit Multiselect field

我都这样用过:

{
    xtype:'multiselectfield', //tagfield
    multiSelect: true,
    displayField: 'name',
    required: true,
    store: [
        { name: 'Peter',  age: 26 },
        { name: 'Ray',   age: 21 },
        { name: 'Egon', age: 24 },
        { name: 'Winston', age: 24 }
     ],
    label : 'People'
}

第一个自定义字段用于显示我商店中的数据,但我没有绑定选定的值。

第二个抛出了一些错误,当修复它们时它根本没有显示我商店中的任何值,所以我没有机会绑定选定的值。

所以我想知道如何将多选字段中的选定值与我的 viewModel 绑定。 这是我的小提琴:https://fiddle.sencha.com/#view/editor&fiddle/2lf0

【问题讨论】:

    标签: javascript extjs multi-select extjs6 extjs6-modern


    【解决方案1】:

    被选中的喜欢:

    {
       xtype: 'tagfield',
       itemId: 'tagfield',
       multiSelect : true,
       displayField: 'name',
       valueField: 'id',
       bind: {
           label: '{i18n.topic.topics} ',
           store: '{topics}',
           selected: '{record.topics}'
       },
    }
    

    【讨论】:

      猜你喜欢
      • 2017-10-22
      • 2019-02-26
      • 1970-01-01
      • 1970-01-01
      • 2018-04-19
      • 1970-01-01
      • 2018-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多