Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to display multiselect values from the combobox to the gridpanel extjs 4
    primarykey
    data
    text
    <p>forum member I am having one problem is displaying the combobox name selected values to my gridpanel column.</p> <p>I am having the gridPanel with one column containing the resources combobox and the user can select multiple values from the resource.</p> <p>below is my gridpanel column with the column combobox <strong>gridpanel column</strong></p> <pre><code>{ xtype: 'gridcolumn', dataIndex: 'resourceid', text: 'Resource', field: resourcecombo }, </code></pre> <p><strong>resourcecombo</strong></p> <pre><code>var resourcecombo = new Ext.form.ComboBox({ id: 'resourceid', name: 'resourceid', emptyText: 'Select resource', displayField: 'firstname', store: Ext.create('rms.store.employee'), valueField: 'id', multiSelect: true, queryMode: 'local', typeAhead: true }); </code></pre> <p>here I getting the list of resources and I can do multiselect also. Based on this multiselect the id is send to server and with the response I want to set the values to grid column.</p> <p>but, something wrong is there I am getting the correct response from server, <strong>but my gridcolumn displays only one name in this column.</strong>.</p> <p>I want to display the name of all the resource selected, separated by comma sign <strong>,</strong> like <strong>rishi,yogi,hiren etc</strong></p> <p><strong>solution</strong> just change the gridcolumn with below code</p> <pre><code>xtype: 'gridcolumn', dataIndex: 'resources', header: 'Resources name', field: resourcecombo, renderer: function(resources){ var result = []; resources = resources || []; for (var idx = 0, len = resources.length; idx &lt; len; idx++ ){ var value = resources[idx].name; if(value){ result.push(value); } } return result.join(', '); } </code></pre> <p>and change the model with below code</p> <pre><code>Ext.define('rms.model.taskmainModel', { extend : 'Ext.data.Model', fields : [ { name : 'id', type : 'int' }, { name : 'taskname', type: 'string'}, **{ name : 'resources', type: 'auto'},** { name : 'cmpname', mapping: 'project.company.cmpname'} ] }); </code></pre> <p>above solution works for me, hope this may help some one.</p> <p>thanks for your support.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload