1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Question Answered: RowEditor capture the button clicks

    Answered: RowEditor capture the button clicks


    Hey at all

    I have a question about the RowEditor. I have a Grid with the RowEditor and I would like to make some checks on the Fields befor I save the row.
    normaly I do this with the afterEdit-Event or cancelEdit-Event but if I startEditing and click directly after that the save-Button the two Events don't take effect.

    Where is the mistake? Which Event should I try?

  2. That is what i told you. The method is not firing an event because the editor is valid and there is no change.

    Now there are two solutions:
    1) Change the logic of this method so it fits your needs
    2) Create some completly differetn logic when clicking on the save button.

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    If there are no changes and the RowEditor is in a valid state, than the RowEditor is just hidden. Take a look at the stopEditing method.

  4. #3
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    I don't get it. What has the Method stopEditing to do with the Events?
    I need a Event if the Editor hide. Or I need a Event if the Save or Cancel Button are activatet.

  5. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I don't get it. What has the Method stopEditing to do with the Events?
    This method fires the events.

  6. #5
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    But I don't use this method.

  7. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    It gets called internly when clicking on the buttons.

  8. #7
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    Ok.
    Is there a possibillity that I can Override the Save-Button?

  9. #8
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You can change anything you want to change. You can extend RowEditor and add your own features and changes. As i said, i would start taking a look at this method to understand how any why the events are fired currently. You maybe also want to look at createButtons

  10. #9
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    I debugged the method and I know now that no Event is fired.

    Code:
    if (!saveChanges || !isValid()) {
          fireEvent(Events.CancelEdit, ree);
        } else if (hasChange && fireEvent(Events.ValidateEdit, ree)) {
          record.beginEdit();
          for (String k : data.keySet()) {
            record.set(k, data.get(k));
          }
          record.endEdit();
          fireEvent(Events.AfterEdit, ree);
        }
        hide();
    What can I do now? Override this method?

  11. #10
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    That is what i told you. The method is not firing an event because the editor is valid and there is no change.

    Now there are two solutions:
    1) Change the logic of this method so it fits your needs
    2) Create some completly differetn logic when clicking on the save button.

Thread Participants: 1