PDA

View Full Version : [CLOSED] I can not select an item from selectbox



Quico
Apr 08, 2014, 5:01 PM
<ext:FieldContainer ID="fcCod_Provincia" runat="server" Flex="1" Layout="HBoxLayout" DefaultAnchor="100%">
<Items>
<ext:SelectBox ID="Cod_Provincia" Name="Cod_Provincia" runat="server" FieldLabel="<b>Provincia</b>"
AllowBlank="false" DisplayField="DESCRIPCION" ValueField="COD_PROVINCIA" QueryMode="Local"
ForceSelection="true" TriggerAction="All" EmptyText="Seleccionar..." Editable="true" MsgTarget="Qtip"
Flex="1" Margins="0 3 0 0" MatchFieldWidth="true" TypeAhead="true" >
<Store>
<ext:Store ID="StoreCod_Provincia" runat="server" AutoLoad="false" >
<Model>
<ext:Model ID="ModelCod_Provincia" runat="server" IDProperty="COD_PROVINCIA">
<Fields>
<ext:ModelField Name="COD_PROVINCIA" Type="String" Mapping="COD_PROVINCIA" />
<ext:ModelField Name="DESCRIPCION" Type="String" Mapping="DESCRIPCION" />
</Fields>
</ext:Model>
</Model>
<Sorters>
<ext:DataSorter Property="DESCRIPCION" Direction="ASC" />
</Sorters>
<Listeners>
<DataChanged Handler="if(#{StoreCod_Provincia}.getTotalCount() != 0) { var record = this.getAt(0);
#{Cod_Provincia}.setValue(record.data.COD_PROVINCI A); } " Delay="10" />
</Listeners>
</ext:Store>
</Store>
<Listeners>
<Select Handler="var record = records[0].data; #{Cod_Provincia}.setValue(record.COD_PROVINCIA);" />
</Listeners>
</ext:SelectBox>
<ext:Button ID="btnFindCod_Provincia" runat="server" Icon="Find" ToolTip="Buscar Provincia" ToolTipType="Title" Margins="0 5 0 0" >
<Listeners>
<Click Handler="#{hControlQueLlama}.setValue(#{Cod_Provincia}.id); win = #{WindowPROVINCIA}; win.show();" />
</Listeners>
</ext:Button>
</Items>
</ext:FieldContainer>


9611

Thank you.

Daniil
Apr 08, 2014, 6:13 PM
Hi @Quico,

Can you select if remove the following?

<Select Handler="var record = records[0].data; #{Cod_Provincia}.setValue(record.COD_PROVINCIA);" />

The Select listener looks strange. Please clarify what is it for?

Quico
Apr 08, 2014, 6:34 PM
Hi @Quico,

Can you select if remove the following?

<Select Handler="var record = records[0].data; #{Cod_Provincia}.setValue(record.COD_PROVINCIA);" />

The Select listener looks strange. Please clarify what is it for?

I remove the line and remains the same.

Quico
Apr 08, 2014, 6:54 PM
I remove the line and remains the same.

I have another combobox that has the same thing and it works. The only difference is that the ID is int



<ext:FieldContainer ID="fcPais_ID" runat="server" Flex="1" Layout="HBoxLayout" DefaultAnchor="100%">
<Items>
<ext:SelectBox ID="Pais_ID" Name="Pais_ID" runat="server" FieldLabel="<b>Pais</b>"
AllowBlank="false" DisplayField="Pais" ValueField="Pais_ID" TypeAhead="true" QueryMode="Local"
ForceSelection="true" TriggerAction="All" EmptyText="Seleccionar..." Editable="false" MsgTarget="Qtip"
MinChars="1" MatchFieldWidth="true" Flex="1" Margins="0 3 0 0" Selectable="true" >
<Store>
<ext:Store ID="StorePais_ID" runat="server">
<Model>
<ext:Model ID="ModelPais_ID" runat="server" IDProperty="Pais_ID">
<Fields>
<ext:ModelField Name="Pais_ID" />
<ext:ModelField Name="Pais" />
</Fields>
</ext:Model>
</Model>
<Sorters>
<ext:DataSorter Property="Pais" Direction="ASC" />
</Sorters>
<Listeners>
<DataChanged Handler="if(#{StorePais_ID}.getTotalCount() != 0) { var record = this.getAt(0);
#{Pais_ID}.setValue(record.data.Pais_ID); } " Delay="10" />
</Listeners>
</ext:Store>
</Store>
<Listeners>
<Select Handler="var record = records[0].data; #{Pais_ID}.setValue(record.Pais_ID);" />
</Listeners>
</ext:SelectBox>
<ext:Button ID="btnFindPais_ID" runat="server" Icon="Find" ToolTip="Buscar Pais" ToolTipType="Title" Margins="0 5 0 0" >
<Listeners>
<Click Handler="#{hControlQueLlama}.setValue(#{Pais_ID}.id); win = #{WindowPaises}; win.show();" />
</Listeners>
</ext:Button>
</Items>
</ext:FieldContainer>

Daniil
Apr 08, 2014, 7:06 PM
Sorry, I cannot reproduce. Please provide a full runnable test case to reproduce the problem. Also please specify Ext.NET version you are working with.

Quico
Apr 08, 2014, 7:33 PM
Sorry, I cannot reproduce. Please provide a full runnable test case to reproduce the problem. Also please specify Ext.NET version you are working with.

Version 2.5.

I do not know that provide a full runnable test case.

Daniil
Apr 08, 2014, 7:51 PM
I do not know that provide a full runnable test case.

A standalone example which we can copy, paste and run without any changes from our side. Here you can see such a sample.
Forum Guidelines For Posting New Topics (http://forums.ext.net/showthread.php?3440)