PDA

View Full Version : editorGridPanel, setConfig with metaData from server



wpichler
13 Sep 2008, 12:04 AM
Hi all,

i do have an editorGridPanel with an attached Store which does get its config from the server as metaData. In the metaData included is the config for the columnModel. So on the store metaData event i do also call the columnModel setConfig method to reconfigure the column model.

Does work quit well - beside of one thing i can't figure out how to make it working smoothly...

I do also want to include column editors for some columns - but when i do generate a editor: "new Ext.form.NumberField()" line on the server then the client does interpret it as string and not as new Ext Component (it is a string - so not the client fault) - on the server side i am using json_encode to encode the raw array data - so no real chance to get around the "...

It would surly be possible to parse the metaData before passing it to setConfig - and removing the editor: "...." part with editor: .... - but maybe there is a better method available ?

regards,
Wolfgang

wpichler
13 Sep 2008, 12:19 AM
i am currently using this code



for(var i = 0;i < meta.fields.length;i++) {
if (meta.fields[i].editor) {
meta.fields[i].editor = eval(meta.fields[i].editor);
}
}


does work as expected