Sep 30, 2015, 10:30 AM
[CLOSED] Enable and disable the controls in particular sequence
Hi,
I need to populate the grid with data (in the example, 3 records).
At first viewing it should only be enabled the first "NumberField", one corresponding to Record 0 ... while the other two "NumberField" should be disabled.
When I change the value of the first "NumberField" and this reaches its maximum value "Value = MaxValue", I must enable the second "NumberField" and disable the first.
When I change the value of secndo "NumberField" and this reaches its maximum value "Value = MaxValue", should enable the third "NumberField" and disable the second.
and so on...
What is the best way to implement this working?
I need to populate the grid with data (in the example, 3 records).
At first viewing it should only be enabled the first "NumberField", one corresponding to Record 0 ... while the other two "NumberField" should be disabled.
When I change the value of the first "NumberField" and this reaches its maximum value "Value = MaxValue", I must enable the second "NumberField" and disable the first.
When I change the value of secndo "NumberField" and this reaches its maximum value "Value = MaxValue", should enable the third "NumberField" and disable the second.
and so on...
What is the best way to implement this working?
<%@ Page Language="vb" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Not Ext.Net.X.IsAjaxRequest) Then
Dim Data As New List(Of Object)
Data.Add(New Object() {"Desc 1", 1, 4})
Data.Add(New Object() {"Desc 2", 2, 6})
Data.Add(New Object() {"Desc 3", 3, 8})
GridPanel1.GetStore().DataSource = Data
GridPanel1.GetStore().DataBind()
End If
End Sub
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Description" />
<ext:ModelField Name="Quantity" />
<ext:ModelField Name="MaxQuantity" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Description" DataIndex="Description" />
<ext:ComponentColumn runat="server" Text="Max quantity" DataIndex="Quantity" >
<Component>
<ext:NumberField runat="server" ID="NumberFieldQuantita" MinValue="0" />
</Component>
<Listeners>
<BeforeBind Handler="e.config[0].value = e.record.data.Quantity; e.config[0].maxValue = e.record.data.MaxQuantity"/>
</Listeners>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>
Last edited by Daniil; Oct 06, 2015 at 11:24 AM.
Reason: [CLOSED]