View Full Version : [CLOSED] How to implement RowEditing for newly added row in CellEditing GridPanel

Nov 10, 2015, 12:17 PM

Can any one please give me the solution for the following criteria. Which is

I have a GridPanel with CellEditing Plugin

I was adding a new row on ViewReady listener like

function onGridReady(item) {
var me = item,
view = me.view,
grid = me.view.up('gridpanel');

grid.store.insert(grid.store.getCount(), { });

var pos = grid.getStore().getCount() - 1;

// Here I just need to display entire new row as editable with Add button
// Below code is to edit the first cell of newly added row
grid.editingPlugin.startEdit(pos, 0);

I have tried from StartEdit and startEditByPosition as well. But these 2 methods to edit the Cells only, not for the entire row.

Here the new row should be always editable.

My Grid looks like below

<ext:GridPanel ID="gridExample" runat="server" StoreID="storeExample" Border="true" Height="100" Scroll="Both" Layout="FitLayout">
<ColumnModel ID="ColumnModel2" runat="server">
<ext:ImageCommandColumn ID="columnGo" runat="server" Align="Right" Text="" Hideable="true" Width="25">
<ext:ImageCommand CommandName="GotoPage" Icon="PageWhiteGo" Text="" Style="margin: 1px 1px 0px 2px !important">
<ToolTip Text="Go to Page" />
<PrepareCommand Fn="gotoPageCommand" />
<ext:Column runat="server" ID="Column12" DataIndex="Type" Text="Type" Flex="1">
<ext:ComboBox ID="cboType" runat="server" StoreID="storeType" DisplayField="Display" ValueField="Display">
<ext:Column runat="server" ID="Column11" DataIndex="FirstName" Text="First Name" Flex="1" EmptyCellText="First Name">
<ext:TextField ID="TextField5" runat="server">
<ext:GridView ID="GridView2" runat="server" StripeRows="true" TrackOver="false" />
<ext:CellEditing ClicksToEdit="1">
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
<ViewReady Handler="onGridReady(this);" />

Thank you

Nov 10, 2015, 12:32 PM
Hi @iansriley,

Unfortunately, CellEditing can show an editor for a single cell only. Also CellEditing cannot be mixed with RowEditing.

Off the top of my head, I would recommend to consider changing the approach to something else. For example, before adding a row, you could show a special form where a user can fill out all the fields and the row would be added to a GridPanel after clicking the Add button.