[CLOSED] How to enable pineditor after inserting a new row

  1. #1

    [CLOSED] How to enable pineditor after inserting a new row

    Hello,

    I have a Adressbook similar to this demo:

    https://examples2.ext.net/#/GridPane...mn/Pin_Editor/

    This is the editing start/stop edit function like in the demo:

             var pinEditors = function (btn, pressed) {
                 var columnConfig = btn.column,
                     column = columnConfig.column;
    
                 if (pressed) {
                     column.pinOverComponent();
                     column.showComponent(columnConfig.record, true);
                     App.buttonSave.disable();
                 } else {
                     column.unpinOverComponent();
                     column.hideComponent(true);
                     App.buttonSave.enable();
                 }
             };
    I have a 'New' button that adds a new row:

                <ext:Button ID="ButtonAdd" runat="server" Text="Neu" Icon="Add" ToolTip="Neuen Eintrag hinzuf&uuml;gen">
                    <Listeners>
                        <Click Handler="var rowIndex = #{GridPanelAddress}.store.insert(0, {}); #{GridPanelAddress}.getView().focusRow(0);" />
                    </Listeners>
                </ext:Button>
    Is there any way to activate the edit mode (with a toggled pin button) after the new row has been inserted? Currently, the user needs to hover the empty row and click the pin editor button.

    Regards
    Last edited by Daniil; Apr 16, 2013 at 5:31 AM. Reason: [CLOSED]
  2. #2
    Hi @blueworld,

    Please try the following:
    <ext:Button runat="server" Text="Add" Icon="Add">
        <Listeners>
            <Click Fn="add" />
        </Listeners>
    </ext:Button>
    var add = function () {
        var grid = App.GridPanel1, 
            column = App.ComponentColumnWithEditButton,
            record = grid.getStore().insert(0, {})[0]; 
    
        column.showComponent(record, grid.getView().getNode(0), 0);
        column.overComponent.toggle();
                
    };
  3. #3
    Hi Daniil,

    thank you very much, this is very nice!
    Would it be possible to move the cursor into the first cell after the edit mode has been enabled ? (row 0,column 0)
  4. #4
    Quote Originally Posted by blueworld View Post
    Would it be possible to move the cursor into the first cell after the edit mode has been enabled ? (row 0,column 0)
    I think it is possible. I would call the focus method on a ComponentColumn's component.

Similar Threads

  1. [CLOSED] Inserting a row to a GridPanel...
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 25, 2011, 4:26 PM
  2. Inserting Image using HtmlEditor
    By designworxz in forum 1.x Help
    Replies: 2
    Last Post: Jan 08, 2010, 3:59 PM
  3. Inserting a blank value into combobox
    By FreddieBoo in forum 1.x Help
    Replies: 1
    Last Post: May 26, 2009, 9:19 AM
  4. Replies: 0
    Last Post: Mar 16, 2009, 8:46 AM
  5. Inserting a Row
    By mono in forum 1.x Help
    Replies: 6
    Last Post: Mar 16, 2009, 4:57 AM

Posting Permissions