我有一个下拉字段,我正在尝试在AfterRender上重新加载它的商店但我收到此错误:
无法读取未定义
的属性'reload'
以下是代码:
Javascript重新加载:
function LoadAll(){
#{StoreFieldNames}.reload();
}
Ext代码:
Window afterRender:
<AfterRender Handler="LoadAll();" />
Gridpanel中的DropDownField编辑器
<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 to choose this 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>
答案 0 :(得分:0)
无法读取属性&#39;重新加载&#39;未定义的
在ExtJs docs中,提供了获取商店和商店的方法,以及加载数据的方法。您可以参考ExtJs docs
我已经创建了一个小型演示来向您展示它是如何工作的。 Sencha fiddle example
{{1}}