-
6 Sep 2011 1:21 AM #1
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?
-
Best Answer Posted by sven
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.
-
6 Sep 2011 3:10 AM #2
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.
-
6 Sep 2011 3:20 AM #3
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.
-
6 Sep 2011 3:21 AM #4
This method fires the events.I don't get it. What has the Method stopEditing to do with the Events?
-
6 Sep 2011 3:22 AM #5
But I don't use this method.
-
6 Sep 2011 3:23 AM #6
It gets called internly when clicking on the buttons.
-
6 Sep 2011 3:25 AM #7
Ok.
Is there a possibillity that I can Override the Save-Button?
-
6 Sep 2011 3:27 AM #8
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
-
6 Sep 2011 3:40 AM #9
I debugged the method and I know now that no Event is fired.
What can I do now? Override this method?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();
-
6 Sep 2011 3:41 AM #10
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.


Reply With Quote