[CLOSED] How to implement RowEditing for newly added row in CellEditing GridPanel

  1. #1

    [CLOSED] How to implement RowEditing for newly added row in CellEditing GridPanel

    Hi,

    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;
        grid.selModel.selectByPosition(pos);
    
    // 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">                                           
        <Columns>                                                
         <ext:ImageCommandColumn ID="columnGo" runat="server" Align="Right" Text="" Hideable="true" Width="25">
          <Commands>                                                        
            <ext:ImageCommand CommandName="GotoPage" Icon="PageWhiteGo" Text="" Style="margin: 1px 1px 0px 2px !important">
              <ToolTip Text="Go to Page" />                                                        
            </ext:ImageCommand>
           </Commands>
           <PrepareCommand Fn="gotoPageCommand" />
          </ext:ImageCommandColumn>                                                
          <ext:Column runat="server" ID="Column12" DataIndex="Type" Text="Type" Flex="1">                                                    
           <Editor>                                                        
            <ext:ComboBox ID="cboType" runat="server" StoreID="storeType" DisplayField="Display" ValueField="Display">                     
            </ext:ComboBox>
            </Editor>                                                
           </ext:Column>                                                
           <ext:Column runat="server" ID="Column11" DataIndex="FirstName" Text="First Name" Flex="1" EmptyCellText="First Name">
            <Editor>                                                        
             <ext:TextField ID="TextField5" runat="server">                                                        
             </ext:TextField>                                                    
            </Editor>                                                
           </ext:Column>                                                
    ..............................                                                                                            
         </Columns>                                        
        </ColumnModel>                                        
        <View>                                            
         <ext:GridView ID="GridView2" runat="server" StripeRows="true" TrackOver="false" />                                        
        </View>                                        
        <Plugins>                                           
         <ext:CellEditing ClicksToEdit="1">                                            
         </ext:CellEditing>                                        
        </Plugins>                                        
        <SelectionModel>                                            
          <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />                                        
        </SelectionModel>                                        
        <Listeners>                                            
         <ViewReady Handler="onGridReady(this);" />                                        
        </Listeners>                                    
     </ext:GridPanel>

    Thank you
    Last edited by Daniil; Nov 17, 2015 at 11:02 AM. Reason: [CLOSED]
  2. #2
    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.

Similar Threads

  1. [CLOSED] How to set NodeID to newly added node via script
    By ingbabic in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 15, 2015, 7:11 AM
  2. [CLOSED] Get RecordID of Newly Added Row
    By hemantpatil in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 15, 2013, 6:30 AM
  3. Edit the Newly added column in gridpanel
    By thota in forum 2.x Help
    Replies: 0
    Last Post: Dec 26, 2012, 11:02 AM
  4. Replies: 0
    Last Post: May 24, 2012, 7:39 AM
  5. [CLOSED] How to set the ID of a newly added tree node
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 11, 2011, 7:34 AM

Posting Permissions