-
21 May 2009 2:13 AM #1
How to set combo in PropertyGrid
How to set combo in PropertyGrid
I just going through the PropertyGrid example came with Ext 3.0.
I am trying to add a Combo box to the Property Grid but it is not working.
Here is my code
------------------
But the Category field is not displayed and also i see no error.Code:Ext.onReady(function(){ var propsGrid = new Ext.grid.PropertyGrid({ el:'props-grid', nameText: 'Properties Grid', width:300, autoHeight:true, viewConfig : { forceFit:true, scrollOffset:2 // the grid will never have scrollbars } }); propsGrid.render(); var comboCategory = new Ext.form.ComboBox({ fieldLabel : 'Category', name : 'category', allowBlank : false, store : ['Business', 'Personal'], typeAhead : true, mode : 'local', triggerAction: 'all' }); propsGrid.setSource({ "(name)": "Properties Grid", "grouping": false, "autoFitColumns": true, "productionQuality": false, "created": new Date(Date.parse('10/15/2006')), "tested": false, "version": 0.01, "borderWidth": 1, "Category": new Ext.grid.GridEditor(new Ext.form.TextField({ allowBlank : true })) }); });
Anyone let me know where i am going wrong?
Thanks,
venu
-
21 May 2009 3:35 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 33
source is meant for a name : value data set.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 May 2009 5:21 PM #3
Thanks for reply.
Is there any example of setting the combo in the PropertyGrid?
-
25 May 2009 7:32 PM #4
SOLVED - How to set combo in PropertyGrid
SOLVED - How to set combo in PropertyGrid
SOLVED.
Here is the solution for adding combo and check box to the PropertyGrid.
Code:Ext.onReady(function(){ var comboCategory = new Ext.form.ComboBox({ fieldLabel : 'Category', name : 'category', allowBlank : false, store : ['Business', 'Personal'], typeAhead : true, mode : 'local', triggerAction : 'all', emptyText :'-- Select category --', selectOnFocus :true }); var active = new Ext.form.Checkbox({ name : 'active', fieldLabel : 'Active', checked : true, inputValue : '1' }); var propsGrid = new Ext.grid.PropertyGrid({ el:'props-grid', nameText: 'Properties Grid', width:300, autoHeight:true, viewConfig : { forceFit:true, scrollOffset:2 // the grid will never have scrollbars }, customEditors: { 'Category': new Ext.grid.GridEditor(comboCategory), 'Active' : new Ext.grid.GridEditor(active) } }); propsGrid.render(); propsGrid.setSource({ "(name)": "Properties Grid11", "grouping": false, "autoFitColumns": true, "productionQuality": false, "created": new Date(Date.parse('10/15/2006')), "tested": false, "version": 0.01, "borderWidth": 1, "Category": 'Personal', "Active" : true }); });
-
18 May 2010 1:31 AM #5
The propsGrid.setSource() that you do in your code doesn't seem to have any relationship with the rest of your code.
-
1 Sep 2010 3:22 AM #6
Where is it possible to find
?Code:Ext.grid.GridEditor


Reply With Quote