GridPanel with RowEditor Plugin

  1. #1

    GridPanel with RowEditor Plugin

    hi all,

    i am using this example provided in example section

    https://examples2.ext.net/#/GridPane...ins/RowEditor/

    but i want to change the behavior of row editor plugin.
    i want that when user click cancel then the row should be removed

    also i am facing one more problem that when user click add employee button
    focus does not set to employee name because of date field validation

    please any one have any suggestion

    thanks
    Last edited by d3graph; Oct 02, 2013 at 8:49 AM.
  2. #2
    Hello!

    I will show on the sample mentioned by you.

    Quote Originally Posted by d3graph View Post
    i am using this example provided in example section

    https://examples2.ext.net/#/GridPane...ins/RowEditor/

    but i want to change the behavior of row editor plugin.
    i want that when user click cancel then the row should be removed
    For this you can use CancelEdit event:
    <ext:RowEditing runat="server" ClicksToMoveEditor="1" AutoCancel="false">
        <Listeners>
            <CancelEdit Handler="
                if (this.editing)
                    this.cancelEdit();
                                
                if (e.record.phantom)
                    removeEmployee();
                "></CancelEdit>
        </Listeners>
    </ext:RowEditing>
    In this case you can use delayed task and focusInput method: http://docs.sencha.com/extjs/4.2.2/#...hod-focusInput
    Quote Originally Posted by d3graph View Post
    also i am facing one more problem that when user click add employee button
    focus does not set to employee name because of date field validation

    please any one have any suggestion

    thanks
    var addEmployee = function () {
    	var grid = #{GridPanel1};
    	grid.editingPlugin.cancelEdit();
    
    	// Create a record instance through the ModelManager
    	var r = Ext.ModelManager.create({
    		name: 'New Guy',
    		email: 'new@object.net',
    		start: Ext.Date.clearTime(new Date()),
    		salary: 50000,
    		active: true
    	}, 'Employee');
    
    	grid.store.insert(0, r);
    	grid.editingPlugin.startEdit(0, 0);
    	
            // Create DelayedTask and call it after 100 ms
    	var task = new Ext.util.DelayedTask(function(){
    		grid.columns[1].getEditor().focusInput();
    	});
    
    	task.delay(100);
    };

Similar Threads

  1. Ext.Net:GridPanel with RowEditor Plugin
    By ada in forum 2.x Help
    Replies: 0
    Last Post: Jun 09, 2013, 5:24 AM
  2. RowEditor Plugin for GridPanel
    By bright in forum 1.x Help
    Replies: 0
    Last Post: Feb 17, 2012, 3:04 PM
  3. Replies: 1
    Last Post: Dec 21, 2011, 5:32 AM
  4. [CLOSED] GridPanel RowEditor Plugin problem with AutoHeight
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 21, 2010, 10:48 PM
  5. [CLOSED] [1.0] GridPanel RowEditor Plugin ValidateEdit problem
    By kemalyigit in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 29, 2010, 10:51 AM

Tags for this Thread

Posting Permissions