javascript - EXT: Cannot read property 'reload' of undefined -
i have dropdown field , trying reload store on afterrender receive error:
cannot read property 'reload' of undefined
here code:
javascript reload:
function loadall(){ #{storefieldnames}.reload(); }
ext code:
window afterrender:
<afterrender handler="loadall();" />
dropdownfield editor in gridpanel
<ext:dropdownfield id="dropdownfield2" runat="server" fieldlabel="field name"> <component> <ext:gridpanel id="fieldnamegridpanel" runat="server" frame="true"> <store> <ext:store id="storefieldnames" runat="server" groupfield="form" onreaddata="storefieldnames_readdata"> <model> <ext:model id="modelfieldnames" runat="server"> <fields> <ext:modelfield name="form" /> <ext:modelfield name="fieldname" /> </fields> </ext:model> </model> </ext:store> </store> <columnmodel runat="server"> <columns> <ext:column runat="server" text="form" dataindex="form" flex="6" /> <ext:column runat="server" dataindex="fieldname" flex="6" /> <ext:imagecommandcolumn runat="server" align="center" flex="1"> <commands> <ext:imagecommand icon="accept" commandname="pick"> <tooltip text="click choose fieldname" /> </ext:imagecommand> </commands> <listeners> <command handler="this.gridref.dropdownfield.setvalue(record.data.fieldname);" /> </listeners> </ext:imagecommandcolumn> </columns> </columnmodel> <view> <ext:gridview id="gridview3" runat="server" loadmask="true" /> </view> <selectionmodel> <ext:rowselectionmodel id="rowselectionmodel3" runat="server" mode="multi" /> </selectionmodel> <features> <ext:grouping id="grouping3 runat="server" hidegroupedheader="true" startcollapsed="true" /> </features> </ext:gridpanel> </component> </ext:dropdownfield>
cannot read property 'reload' of undefined
in extjs docs provide method store combo , store have method load data. can refer extjs docs
i have create small demo show you, how work. sencha fiddle example
var store = ext.create('ext.data.store', { fields: [ 'id','email', 'first', 'last' ], proxy: { type: 'ajax', url: 'person.json', reader: { type: 'json', rootproperty: 'data' } } }); ext.create('ext.form.combobox', { store: store, querymode: 'local', margin:20, displayfield: 'first', valuefield: 'id', renderto: ext.getbody(), emptytext:'select', listeners: { afterrender: function () { this.getstore().load(); } } });
Comments
Post a Comment