PDA

View Full Version : Extending RowEditor



fennecFox
23 May 2014, 10:27 AM
Hi

I'm using the RowEditing functionality for editing rows inline in a gridpanel.

I have a requirement to position the save/cancel buttons to the middle right of the row (instead of their current position which is below the row being edited in the middle)

Now, I have achieved this through extending Ext.grid.RowEditor and overriding the 'reposition' function which deals with positioning the editor and the floating save/cancel buttons.

All works well, but I'm wondering if I've gone about this the right way. The main reason I'm thinking like this is because this note in the docs under Ext.grid.RowEditor worries me:


NOTE:
This is a private utility class for internal use by the framework. Don't rely on its existence.


But in my case, I am relying on its existence as I'm extending it!

I'm a newbie here, so any comment/thoughts would be appreciated

Gary Schlosberg
23 May 2014, 2:16 PM
Sometimes the only way to achieve the functionality you want is to extend a private method. You'll have to evaluate the risks yourself. Even overrides to public methods need to be updated sometimes with the coming of new version releases, or removed if a bug has been corrected. Looks like the reposition method has been in the framework since 4.0.7, and is still present in 5.0.0 (and still private).