Nov 01, 2012, 4:28 PM
Disable some items in a Combobox
I'm trying to follow this example: http://forums.ext.net/showthread.php...ms-in-combobox
But i'm a little lost, doing the same thing but ... loading the info from a Store.
I have a controller that get me a DataTable with this columns:
- Codigo
- Nombre
- Movimiento (have 1 or 0 to know which one will be disabled)
In the view I have this store:
Thanks in advance!
But i'm a little lost, doing the same thing but ... loading the info from a Store.
I have a controller that get me a DataTable with this columns:
- Codigo
- Nombre
- Movimiento (have 1 or 0 to know which one will be disabled)
In the view I have this store:
<ext:Store ID="EncCodigoStore" runat="server" RemotePaging="false" RemoteSort="false" ShowWarningOnFailure="false" >
<Proxy>
<ext:HttpProxy Json="true" Method="GET" Url="~/EntidadesComunicacion/GetDataForList" />
</Proxy>
<DirectEventConfig IsUpload="true" />
<Reader>
<ext:JsonReader Root="data" TotalProperty="total" IDProperty="Codigo">
<Fields>
<ext:RecordField Name="Codigo" />
<ext:RecordField Name="Nombre" />
<ext:RecordField Name="Movimiento" />
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="Codigo" Direction="ASC" />
<Listeners>
<LoadException Handler="if (response.status === 200 ) { } else Ext.MessageBox.alert('La consulta que se estaba realizando no se pudo completar.', response.statusText);" />
</Listeners>
</ext:Store>
And I have this combo: <ext:ComboBox ID="EncCodigo" runat="server" AllowBlank="true" Editable="false" FieldLabel="Entidad"
StoreID="EncCodigoStore" ValueField="Codigo" DisplayField="Nombre">
<Listeners>
<Select Handler="this.triggers[0].show();" />
<BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
</Listeners>
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
</ext:ComboBox>
How can I use the Movimiento column in store to disable the items with 0 value?Thanks in advance!
Last edited by equiman; Nov 01, 2012 at 4:35 PM.