-
16 Apr 2012 11:54 AM #1
Urgent: ComboBox In Grid
Urgent: ComboBox In Grid
Hi,
I am trying to display following json into a grid.
I need grid columns as Name and Conditions.Code:{ "name": "XYZ", "columns": [ { "name": "FName", "conditions": [ { "name": "Equals" }, { "name": "NotEquals" } ] }, { "name": "Salary", "conditions": [ { "name": "Greater Than" }, { "name": "Lesser Than" } ] } ] }
Conditions column to be a Combo Box with different values in each row i.e from conditions node.
My Combox is displaying values as [object Object],[object Object].
Please help me to resolve this issue.
-
16 Apr 2012 2:22 PM #2
You will need to provided any information about your store/model/proxy. How are you populating your combo? Do you have another store for this data? You description is very vague.
Scott.
-
16 Apr 2012 2:33 PM #3
My Model:
My Store:Ext.define('MyApp.model.Column', { extend: 'Ext.data.Model',
fields: [
{
name: 'name'
},
{
name: 'conditions'
}
]
});
My Grid Panel:Ext.define('MyApp.store.MyJsonStore', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.Column'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
storeId: 'MyJsonStore',
model: 'MyApp.model.Column',
proxy: {
type: 'ajax',
url: 'http://localhost/dataStores/config.json',
reader: {
type: 'json',
root: 'columns'
}
}
}, cfg)]);
}
});
Ext.define('MyApp.view.MyPanel', {
extend: 'Ext.panel.Panel',
height: 335,
width: 558,
autoScroll: true,
title: 'My Panel',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'gridpanel',
autoRender: false,
autoScroll: true,
title: 'My Grid Panel',
store: 'MyJsonStore',
viewConfig: {
},
selModel: Ext.create('Ext.selection.CellModel', {
}),
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
ptype: 'cellediting',
clicksToEdit: 1
})
],
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'name',
text: 'Name'
},
{
xtype: 'gridcolumn',
dataIndex: 'conditions',
text: 'Conditions'
}
]
}
]
});
me.callParent(arguments);
}
});
-
19 Apr 2012 1:04 PM #4
-
19 Apr 2012 2:07 PM #5
See examples/grid/cell-editing.html in your SDK for an example.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
23 Apr 2012 10:20 AM #6
My JSON is
Placing an editor in the "Conditions" column with xtype as combobox is not working.
{ "name": "XYZ", "columns": [ { "name": "FName", "conditions": [ { "name": "Equals" }, { "name": "NotEquals" } ] }, { "name": "Salary", "conditions": [ { "name": "Greater Than" }, { "name": "Lesser Than" } ] } ]}
how can i pass Arraylist of a gridcolumn to combobox editor of that column.


Reply With Quote
