asp.net mvc - Set the value of an ExtJS ComboBox to an Object, not an object property -


i have combobox in editorgrid. populating (trying) using json, produced serializing ilist<fertilizertype>. i want valuefield of combobox equal fertilizertype objects , displayfield equal fertilizertype.name

here crop:

{\"id\":1300,\"active\":true,\"code\":\"ammonium bicarbonate\",\"description\":\"ammonium bicarbonate\",\"groupname\":\"fertilizertype\",\"name\":\"ammonium bicarbonate\",\"ordinal\":1} 

why want set valuefield object might ask? well, data in grid part of crop object. combobox needs return fertilizertype crop.fertilizertype can populated.

here column definition:

{             header: 'fertilizer type',             dataindex: 'fertilizertype',             width: 170,             editor: new ext.form.combobox({                 store: new ext.data.store({                     proxy: new ext.data.httpproxy({                         url: cbp.baseurl + 'controller/getfertilizertypes'                     }),                     reader: new ext.data.jsonreader({}, ['fertilizertype', 'fertilizertype.name']),                     remotesort: false                 }),                 valuefield: 'fertilizertype',                 displayfield: 'fertilizertype.name',                 hiddenname: 'ferttypeobject',                 mode: 'remote',                 minchars: 0             })         } 

thanks help! driving me nuts!

i solved problem replicating c# objects in javascript. post server correctly.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -