Jan 10, 2011, 6:30 PM
[CLOSED] editable gridpanel enable/disable fields
We have implemeted editable gridpanel in our application. for each row,we would like enable/disable fields based on a value.
if record.data.plans > 0 then enable txtHalfsize and txtFullSize fields and disable txtspecs
if record.data.specs > 0 then disable txtHalfSize and txtFullSize and enable txtspecs
How do I do this ?
if record.data.plans > 0 then enable txtHalfsize and txtFullSize fields and disable txtspecs
if record.data.specs > 0 then disable txtHalfSize and txtFullSize and enable txtspecs
How do I do this ?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CartItems.aspx.cs" Inherits="CooliteDemo.Planroom.UserControls.CartItems" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:GridPanel ID="ItemGrid" runat="server" StripeRows="true" AutoExpandColumn="DocumentName"
Title="Choose the files,enter the quantity and select recipients" ClicksToEdit="1"
IconCls="step1" AutoScroll="true" Header="true" AutoWidth="false" Layout="Fit">
<Store>
<ext:Store ID="CheckOutItemStore" IDMode="Explicit" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="ID" Mapping="ID" Type="Int" />
<ext:RecordField Name="BundleId" Mapping="BundleId" />
<ext:RecordField Name="DocumentName" Mapping="DocumentName" />
<ext:RecordField Name="HalfSizeQty" Mapping="HalfSizeQty" Type="Int" />
<ext:RecordField Name="FullSizeQty" Mapping="FullSizeQty" Type="Int" />
<ext:RecordField Name="SpecsQty" Mapping="SpecsQty" Type="Int" />
<ext:RecordField Name="DeliveryTypeID" Mapping="DeliveryTypeID" Type="Int" />
<ext:RecordField Name="Plans" Mapping="Plans" Type="Int" />
<ext:RecordField Name="Specs" Mapping="Specs" Type="Int" />
<ext:RecordField Name="Store" Mapping="PickUpFrom" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column Header="Document Name" Sortable="false" DataIndex="DocumentName" Groupable="false">
</ext:Column>
<ext:NumberColumn Header="Half Size" DataIndex="HalfSizeQty" Width="50">
<Editor>
<ext:NumberField ID="txtHalfSize" runat="server" />
</Editor>
</ext:NumberColumn>
<ext:NumberColumn Header="Full Size" DataIndex="FullSizeQty" Width="50" Groupable="false">
<Editor>
<ext:NumberField ID="txtFullSize" runat="server">
</ext:NumberField>
</Editor>
</ext:NumberColumn>
<ext:NumberColumn Header="Specs" DataIndex="SpecsQty" Width="50">
<Editor>
<ext:NumberField ID="txtSpecs" runat="server" />
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>
<View>
<ext:GridView ForceFit="true" EmptyText="No Items in Cart">
</ext:GridView>
</View>
<Plugins>
<ext:EditableGrid ID="EditableGrid1" runat="server" />
</Plugins>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel110" runat="server" CheckOnly="true">
</ext:CheckboxSelectionModel>
</SelectionModel>
</ext:GridPanel>
</div>
</form>
</body>
</html>
Last edited by Daniil; Jan 12, 2011 at 2:53 PM.
Reason: [CLOSED]