Jul 23, 2013, 8:43 AM
[CLOSED] ComponentColumn checkbox activation
Hi,
I would like to get the following behavior:
When I change the value on the "Servizio" column selectbox, if the record field "new_trasporto" in the combobox store is true, then check the checkbox in the "Trasporto" column.
I would like to get the following behavior:
When I change the value on the "Servizio" column selectbox, if the record field "new_trasporto" in the combobox store is true, then check the checkbox in the "Trasporto" column.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void btnAddService_Click(object sender, DirectEventArgs e)
{
Store store = this.gpRigaListino.GetStore();
store.Add(new
{
RigaListinoID = "",
Trasporto = false,
});
}
private object TestData
{
get
{
return new object[]
{
new object[] { "1", "Servizio 1", true },
new object[] { "2", "Servizio 2", false },
new object[] { "3", "Servizio 3", false },
};
}
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Adding customer services</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:GridPanel ID="gpRigaListino" runat="server" BubbleEvents="true">
<Store>
<ext:Store ID="stRigaListino" runat="server">
<Model>
<ext:Model runat="server" IDProperty="RigaListinoID">
<Fields>
<ext:ModelField Name="RigaListinoID" />
<ext:ModelField Name="Trasporto" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:ComponentColumn ID="ComponentColumn1" runat="server" Editor="true" DataIndex="RigaListinoID"
Flex="1" MinWidth="170" Text="Descrizione">
<Component>
<ext:ComboBox ID="cbRigaListinoExp2" runat="server" Name="RigaListino" BillingFieldName="RigaListino"
Flex="1" ValueField="new_rigalistinoId" DisplayField="new_name" TypeAhead="true"
QueryMode="remote" AllowBlank="false" IndicatorIcon="BulletRed" IndicatorTip="Campo obbligatorio"
ValidationGroup="" ForceSelection="true" EmptyText="seleziona un prodotto">
<Store>
<ext:Store Data="<%# TestData %>" runat="server">
<Reader>
<ext:ArrayReader />
</Reader>
<Model>
<ext:Model runat="server" IDProperty="new_rigalistinoId">
<Fields>
<ext:ModelField Name="new_rigalistinoId" />
<ext:ModelField Name="new_name" />
<ext:ModelField Name="new_trasporto" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="ComponentColumn7" runat="server" Editor="true" DataIndex="Trasporto"
Text="Trasporto" Width="65">
<Component>
<ext:Checkbox ID="Checkbox3" runat="server">
</ext:Checkbox>
</Component>
<Listeners>
<Bind Handler="cmp.setReadOnly(!record.data.Trasporto);" />
</Listeners>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
<Buttons>
<ext:Button runat="server" Text="Aggiungi intervento" Icon="Add" OnDirectClick="btnAddService_Click">
<DirectEvents>
<Click>
<EventMask Msg="creazione nuova riga..." ShowMask="true" UseMsg="true" Target="CustomTarget"
CustomTarget="#{gpRigaListino}">
</EventMask>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
<DirectEvents>
<AfterRender OnEvent="btnAddService_Click">
<EventMask ShowMask="true" Msg="caricamento intervento..." Target="CustomTarget"
CustomTarget="#{gpRigaListino}" />
</AfterRender>
</DirectEvents>
</ext:GridPanel>
</body>
</html>
Last edited by Baidaly; Jul 25, 2013 at 12:11 AM.
Reason: [CLOSED]