Results 1 to 4 of 4

Thread: Can`t clear durty cell in grid after editing.

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    28

    Default Can`t clear durty cell in grid after editing.

    Hi all. I have problem, that i can`t clear the the red triangle from cell after i edit it. I know, that you there is commit method, but i am editing cell in a different way.

    On double click row i call a window with form in which i edit some of rows values. The form is submitted to server and when server answers with success i edit the rows information.

    This is the function that is called when i submit the form:
    Code:
    editTask: function() {
            this.taskEditForm.getForm().submit({
                success: function(form,action) {
                    this.editTaskWin.close();
                    var vars = action.result;
                    var edit_store = this.store.getById(vars.id);
                    edit_store.set('title',vars.title);
                    edit_store.dirty = false;
                },
                failure: function(form,action) {
                },
                scope: this
            });
        }
    I am quite new in Ext JS and i know that this may not be the correct way of doing this. I think that i need to get the index of grid`s row and commit it, but i haven't found a way to get the index.

    I know that i can disable the red triangle in css, but that is not acceptable to me and i want to do this in a correct way.

    Can any one help me?

  2. #2
    Sencha User mashiki's Avatar
    Join Date
    Oct 2007
    Location
    Japan
    Posts
    139

    Default

    commit is need.

    Ext.data.Record >
    commit( [Boolean silent] ) : void

    >Usually called by the Ext.data.Store which owns the Record. Commits all changes made to the Record since either creation, or the last commit operation.
    >Developers should subscribe to the Ext.data.Store.update event to have their code notified of commit operations.

    I asked same question. 2 years ago :-)

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    28

    Default

    Thank you very much. I can`t believe that i didn't try commit on the store record.

    So to help others the code now looks like this. I didn't need to use edit_store.dirty = false; In stead i just added edit_store.commit();
    Code:
       editTask: function() {
            this.taskEditForm.getForm().submit({
                success: function(form,action) {
                    this.editTaskWin.close();
                    var vars = action.result;
                    var edit_store = this.store.getById(vars.id);
                    edit_store.set('title',vars.title);
                    edit_store.commit();
                },
                failure: function(form,action) {
                },
                scope: this
            });
        },

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    28

    Default

    P.S. As i am new to this forum, how can i set this thread to SOLVED?

Similar Threads

  1. [DUP][2.2.1] Grid editing - clicking on another cell
    By sidebog7 in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 13 Jun 2009, 5:57 AM
  2. use arrow keys when editing a grid cell?
    By chachi in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Mar 2007, 6:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •