PDA

View Full Version : [CLOSED] gridPanel Inline editing?



aditya
Nov 15, 2013, 12:59 PM
i am using gridPanel inline editing.

<Columns>
<ext:Column ID="Column2" runat="server" Text="Title" DataIndex="ShortDescription" Flex="1" Sortable="False">
<Editor>
<ext:TextArea ID="TextField1" runat="server" Width="450" Grow="True" GrowMax="250" AllowBlank="False">
</ext:TextArea>
</Editor>
</ext:Column>
<ext:Column ID="Column3" runat="server" Text="Description" DataIndex="LongDescription" Flex="1" Sortable="False">
<Editor>
<ext:TextArea ID="TextField2" runat="server" Width="450" Grow="True" GrowMax="250">
</ext:TextArea>
</Editor>
</ext:Column>
<ext:Column ID="Column4" runat="server" Text="BP Value" DataIndex="BPValue" Sortable="False">
</ext:Column>
<ext:Column ID="Column7" runat="server" Text="Rough Value" DataIndex="RoughValue" Sortable="False">
<Editor>
<ext:NumberField ID="NumberField1" runat="server" />
</Editor>
</ext:Column>
</Columns>

case1(when i want to add new row) : when i insert new item it should all 3 column in editable/insert mode.
case2(when i want to update existing row) : but i want only 1st & 2nd column as editable.

how to handle this situation? any help?

Baidaly
Nov 15, 2013, 5:16 PM
Hello!

You should use beforeEdit handler:


<ext:CellEditing runat="server" ClicksToEdit="1">
<Listeners>
<BeforeEdit Handler="
if (e.colIdx == 1 && !e.record.phantom) {
return false;
}" />
</Listeners>
</ext:CellEditing>

aditya
Nov 16, 2013, 4:53 AM
Hello!

You should use beforeEdit handler:


<ext:CellEditing runat="server" ClicksToEdit="1">
<Listeners>
<BeforeEdit Handler="
if (e.colIdx == 1 && !e.record.phantom) {
return false;
}" />
</Listeners>
</ext:CellEditing>
thanks @Baidaly
its working..
please mark this as CLOSED