官术网_书友最值得收藏!

The ItemSelector extension

ItemSelector is a specialized MultiSelect field that renders as a pair with the MultiSelect field; one with the available options and the other with the selected options. A set of buttons in between, allows the items to be moved between the fields and reordered within the selection. Also, they can be moved via drag-and–drop method.

Here, in the following code, a form panel class is defined, in which we are using the ItemSelector extension as an item of this form:

Ext.define('Examples.view.itemselector.ItemSelectorFormPanel', {
  extend : 'Ext.form.Panel',
  alias : 'widget.itemselectorformpanel',
  requires : ['Ext.ux.form.ItemSelector'],

  constructor : function(config) {

    Ext.apply(this, {
      bodyPadding : 10,
      items : [{
        anchor : '100%',
        xtype: 'itemselector',
        name: 'itemselector',
        store : Ext.create('Examples.store.DummyStore'),
        valueField : 'name',
        displayField : 'name',
        fromTitle: 'Available',
        toTitle: 'Selected'

      }]
    });
  this.callParent(arguments);

  }
});

You can see in the following screenshot that the ItemSelector extension is a pair of MultiSelect field where one is loaded with data store:

We can select the values from this available field and can move those values to the Selected field. We can use the arrow buttons or drag-and-drop, to move the values within those fields or reorder between those. If we use the getValue function of this ItemSelector extension, it will return the collection of values available at the Selected field.

The documentation for this extension is available at http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.ux.form.ItemSelector, where you will get all the available configuration options, properties, methods, and events for this extension.

主站蜘蛛池模板: 张家川| 海林市| 莒南县| 灌南县| 沂水县| 东乡县| 砚山县| 海伦市| 凤庆县| 原阳县| 崇文区| 化隆| 阳西县| 枣庄市| 蓝山县| 漠河县| 南江县| 宜城市| 佛学| 嘉兴市| 铁岭市| 杨浦区| 黑山县| 西乌珠穆沁旗| 会东县| 百色市| 开江县| 宁德市| 萨迦县| 辉县市| 黑河市| 宾川县| 南昌县| 册亨县| 永嘉县| 油尖旺区| 华宁县| 黄山市| 汝南县| 龙南县| 历史|