Jun 02, 2016, 8:37 AM
combo bindstore not working?
Hi
I want to be able to dynamically bind a combo box to an existing store. However, the items never appear in the combo box.
It looks like the store has been bound but whenever you open the combo the items dont appear.
NOTE: If I take out the javascript on the Ext.onReady and just assign the StoreId to the combo box everything works fine.
Markup
I want to be able to dynamically bind a combo box to an existing store. However, the items never appear in the combo box.
It looks like the store has been bound but whenever you open the combo the items dont appear.
NOTE: If I take out the javascript on the Ext.onReady and just assign the StoreId to the combo box everything works fine.
Markup
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" ScriptMode="Debug"></ext:ResourceManager>
<ext:Viewport
ID="viewPort1"
runat="server"
Layout="FitLayout">
<Bin>
<ext:Store ID="storeRegions" runat="server">
<Model>
<ext:Model runat="server" IDProperty="RegionId">
<Fields>
<ext:ModelField Name="RegionId" Mapping="RegionId" Type="Int"/>
<ext:ModelField Name="RegionName" Mapping="RegionName" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Bin>
<Items>
<ext:Panel runat="server" ID="panel1">
<Items>
<ext:ComboBox runat="server" ID="ddRegion" ValueField="RegionId" DisplayField="RegionName" Width="300">
</ext:ComboBox>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
<script type="text/javascript">
Ext.onReady(function () {
var combo = Ext.getCmp('ddRegion');
combo.bindStore('storeRegions');
});
</script>
</form>
CodeBehind protected void Page_Load(object sender, EventArgs e)
{
SkillController controller = new SkillController();
storeRegions.Data = controller.GetRegions();
}
Thanks for any help