PDA

View Full Version : How to set Editor type Dynamically for PropertyGrid in ExtJS4?



sanjayon19
5 Mar 2014, 11:32 PM
Hi All,

I've a property Grid which has Text, Number, Combo,Form and different types of Values fields.
I tried with a sample example by giving hard coded values and editors and its working fine.

How do I specify the editor type dynamically when I get the data from Server. Data is coming in JSON format and I'm using propGrid.setSource(data);

Please let me know how to specify editor dynamically.

Thanks & Regards
Sanjay.S

chramer
5 Mar 2014, 11:54 PM
After you loaded the store, just target the column using a selector, and set the editor like so:


grid.down('gridcolumn[dataIndex=name]').setEditor(/*field*/);


Docs: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.column.Column-method-setEditor

sanjayon19
6 Mar 2014, 2:20 AM
Hi,

Thanks for your reply :)

Can you please tell me how can I access the specific name and then set the editor for it?

I'm able to get the access of Column headers but not the content of Property grid. Please help.

I mean if my property grid has 'ABCD' as the name and 'This is Text Field' as the value, how can I access 'ABCD' and set the editor to that.

Please suggest..

Thanks & Regards
Sanjay.S

chramer
6 Mar 2014, 3:56 AM
Maybe this http://joekuan.wordpress.com/2011/03/22/changing-columns-editor-dynamically-in-extjs-roweditor/
will help!