Jun 20, 2012, 10:05 AM
[CLOSED] get record values of the selected combobox item
Hi,
I am trying to call my prepareListItems function wich needs an index parameter representing the selected index of my combobox.
I also tried:
What is the best way to get the selected index of a combobox?
How can I get the store record bound to the combo selected item?
M
I am trying to call my prepareListItems function wich needs an index parameter representing the selected index of my combobox.
I also tried:
<Select Handler="Sauflon.SlowOrder.prepareListItems(records, #{cbConfezioniProdotto}.getSelectedIndex())" />
but i get an error.What is the best way to get the selected index of a combobox?
How can I get the store record bound to the combo selected item?
M
<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
Ext.ns('Sauflon.SlowOrder');
Sauflon.SlowOrder = {
prepareListItems: function (records,index) {
if (records.length > 0) {
var data = [];
var itemValue = {
Quantitaminima: records[index].data.Quantitaminima,
Quantitamultipla: records[index].data.Quantitamultipla,
ProductNumber: records[index].data.Productnumber
};
data.push(itemValue);
return (Ext.encode(data));
}
else return null;
}
}
</script>
</ext:XScript>
<ext:ComboBox ID="cbConfezioniProdotto" runat="server" DisplayField="Description" ValueField="Code" >
<Store>
<ext:Store ID="stConfezioniProdotto" runat="server" PageSize="10" AutoLoad="false" >
<Proxy>
<ext:AjaxProxy Json="true" Url="../WebServices/AjaxWebService.asmx/getConfezioniProdottoLiquidi">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader Root="d.Data" TotalProperty="d.Total" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Code" />
<ext:ModelField Name="Description" />
<ext:ModelField Name="Quantitaminima" Type="Int" />
<ext:ModelField Name="Quantitamultipla" Type="Int" />
<ext:ModelField Name="Productnumber" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Listeners>
<Select Handler="Sauflon.SlowOrder.prepareListItems(records, index)" />
</Listeners>
</ext:ComboBox>
Last edited by Daniil; Jun 26, 2012 at 9:13 PM.
Reason: [CLOSED]