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

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.

主站蜘蛛池模板: 家居| 金阳县| 轮台县| 右玉县| 平阳县| 闻喜县| 保靖县| 德保县| 玉龙| 新乡市| 屏山县| 鄂托克前旗| 堆龙德庆县| 谷城县| 吴旗县| 卢龙县| 民县| 松溪县| 龙川县| 萨嘎县| 涿鹿县| 新密市| 邹平县| 三门县| 广饶县| 江都市| 肇州县| 临桂县| 舟山市| 田东县| 汨罗市| 上林县| 建宁县| 兴仁县| 武穴市| 吴江市| 沧州市| 大荔县| 比如县| 荣成市| 嫩江县|