javascript - How to populate Selected column in ItemSeclector with default values in Ext-JS -
I am using ItemSelector in Extend.ux.form. I have to populate the selected column with some default values. I can correctly populate the available columns, but when I try to set a default store of values to fall, it ends in the available column. Does the following code snippet help me?
var data = [{"" name ":" abcd "}] var ds = SailPoint.Store.createStore ({url: CONTEXT_PATH + '/define/applications/discoverServers.json' , Field: ['name', 'value'], auto-load: true, baseprint: {domain: domain}, listeners: {Load: function () (warning ('store load');}}}); Var itemselectorField = new Ext.Panel (Title: 'Selectors', Width: 700, ID: 'SelectServerId', BodyPadding: 10, Height: 300, Render: 'Madhouse', Layout: 'Fit', Item: [[Xtype:'ItSecilator ', name:' iTresseter ', ID:' Iotacetar field ', Anchor:' 100% ', ImagePath:' ..//images/ex 'Selected', toTitle: 'selected', listeners: {afterrender: 'tjs-ux' ', store: DS, displayfield:' name ', wellfilled:' name ', a llowblank: false, msgTarget:' side ', fromTitle:' available ' Function () {Ext.getCmp ('itemselectorField'). ToField.store.loadData (data); Ext.getCmp ('selectServerId') doLayout (.); Warning ("after render");}}}]}) ; "
You must use the setValue method of your item selector field. Your audience's object should look like this:
Audience: {afterrender: function (field) {// field argument afterrender var a = []; // setValue receives an array for the method (the variable key in the data) {a.push (data [key] .name); } Field.setValue (a); }}
You can take a look at a Bela:
Comments
Post a Comment