PDA

View Full Version : Edit a grid by row


edumrf
05-07-2009, 08:19 AM
Hi, need some help with a couple things.

Is there any way to edit a grid by row instead of editing by cell?
Which event is used to know when the focus goes from one row to another?

Thanks.

javarine
05-07-2009, 09:31 AM
Check out GridPanel docs
http://extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel

I'm sure that the rowclick event would help you accomplish what you are trying to do.

catacaustic
05-07-2009, 06:29 PM
I'm sure that the rowclick event would help you accomplish what you are trying to do.

Unfortunately, no it isn't. The rowclick event only tells the system which row has been clicked, it doesn't provide any sort of editing functionality at all.

For now, I don't think that there is any multi-cell editing for grids in GXT. This feature was only introduces in ExtJS in version 3, so it's something that's very new to the project overall.

If you really need this, a suggestion would be to use the rowclick event to listen for when a row is selected, and use that to pop up a window with a form in it that contains fields for the columns that you want to edit. You should (I haven't looked into it, but it should be around somewhere) be able to find the mouse position or at least the position of that row so you can cover it with the window.

edumrf
05-07-2009, 08:15 PM
Thanks for the tip, i really need to edit by row, guess i'm gonna have to implement from scratch... :(
If i do, i'll make sure to post a tutorial.

sven
05-07-2009, 08:26 PM
GXT 2.0 will also have the functionality. It will be in SVN very very soon.

fvisticot
05-09-2009, 04:44 PM
Did you speak about the RowEditor component (with update/cancel buttons) available in extjs3.0RC1.1?

I have checked in the javadoc of the GXT2.0 and nothing about this RowEditor !!!

Will this feature be available with the next GXT2.0 Release candidate ?
When will the release be available ?

Regards

sven
05-09-2009, 11:37 PM
Yes. It will be available even before 2.0 reaches RC status. It will be avaible in milestone 2

mandriva
05-14-2009, 11:52 AM
Hi, I am working in the RowEditor, i need urgent the api documentation, might be you will send me a version....i don't know....in pdf or something, please ?


thanks

mandriva
05-14-2009, 12:22 PM
I am modifying the RowEditor in a way that I will can update a datebase using php.

Can somebody help me?

ericlam
05-21-2009, 02:38 PM
Is there a way to override the save button? I want to commit the changes after the user clicks on save.

I can't find anything in the API. I tried overriding onComponentEvent to see if the AfterEdit event would fired when clicking the save button and it didn't... So I guessed wrong.

Similarly, I'd like to override the cancel button. In particular, with adding a new row as in the example from http://extjs.com/examples-dev/explorer.html#roweditorgrid, the cancel button really should remove the record from the grid.

ericlam
05-21-2009, 04:46 PM
I figured out that if you override the stopEditing method, we can tell which button was clicked. But that's not very useful since there's no way to have access to the Model from there.

I needed to add a listener for RowEditorEvent, listening for Events.AfterEdit on the RowEditor.