1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default Answered: which plugin to be use for row editing

    Answered: which plugin to be use for row editing


    This question could be very silly and stupid, but I am bit confused why we have two files for row editing ext.grid.plugin.RowEditing and ux.grid.RowEditor.js.

    Which one should be used as plugin so that I can use in my application. my commit is not working while updating. I am using extjs 4.0.7 and even tried 4.1pr

  2. I should have been a bit more explicit

    Yes, the one to use is Ext.grid.plugin.RowEditing

  3. #2
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    The roweditor was an user extension before (the ux variant) for extjs 3. Now in extjs4 it's part of the framework itself.

    So, you should use this version under extjs4

  4. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    Quote Originally Posted by flanders View Post
    The roweditor was an user extension before (the ux variant) for extjs 3. Now in extjs4 it's part of the framework itself.

    So, you should use this version under extjs4
    You meant to say that I should use RowEditor instead of RowEditing ?

  5. #4
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    I should have been a bit more explicit

    Yes, the one to use is Ext.grid.plugin.RowEditing

  6. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    Quote Originally Posted by flanders View Post
    I should have been a bit more explicit

    Yes, the one to use is Ext.grid.plugin.RowEditing
    why record.commit() diesn't work on it? Any work around for this ?

  7. #6
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    Without your code I have no clue But I would guess that you shouldn't use the commit() function but instead sync() the store.

    This is what i used to do back in the day
    Code:
    		this.editor.on('afteredit', function(editor, changes, record, rowIndex) {
    			if (changes.passwordHash) {
    				record.set('passwordHash', base.SHA1(changes.passwordHash));
    			}
    			this.store.save();
    			this.store.reload();
    		}, this);
    		
    		this.editor.on('canceledit', function(editor, forced) {
    			if (this.store.getAt(0).phantom) {
    				this.store.remove(this.store.getAt(0));
    			}
    		}, this);

  8. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    Ext.getCmp('bEditor').on('afteredit', function(editor, changes, record, rowIndex) {
    console.log('@@@@@@');
    editor.store.save();
    console.log('SSSSSSSSS@');
    editor.store.reload();
    console.log('xxxxxxxxxxx@');
    });
    I am getting error as Uncaught TypeError: Cannot call method 'save' of undefined

  9. #8
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    below is the line no 172 in rowediting.js
    // private

    completeEdit: function() {
    var me = this;


    if (me.editing && me.validateEdit()) {
    me.editing = false;
    me.fireEvent('edit', me, me.context);
    }
    },

  10. #9
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    The parameters that are passed to the eventhandler are changed with regards to what i posted. The code i posted is quite old.

    You should put in a console.log(arguments) to explore the arguments and see how you can obtain the correct references. (People note in the docs that the document possibly isn't correct either here)

    something like

    ....on('edit', function(editor) {
    editor.store.sync();
    });

    if I read the docs/comments right

  11. #10
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    Quote Originally Posted by flanders View Post
    The parameters that are passed to the eventhandler are changed with regards to what i posted. The code i posted is quite old.

    You should put in a console.log(arguments) to explore the arguments and see how you can obtain the correct references. (People note in the docs that the document possibly isn't correct either here)

    something like

    ....on('edit', function(editor) {
    editor.store.sync();
    });

    if I read the docs/comments right
    Thanks. I fixed my problem using code as below :
    Editor.on('afteredit', function(editor, changes, record, rowIndex) {
    editor.store.sync();
    GridStore.load();
    });

Thread Participants: 1