PDA

View Full Version : editorgrid (celledit double click) and rowselection-event (rowselect) causes problems



luc98
29 May 2007, 4:09 AM
Hello

I have the following sitution:

I use an editor grid to make data editable. I save the data after the event afteredit is sendet. Each row of the grid represent an item with divers coloums. An item can be in several "states". The stateinformation is added and shown in a separate tab. To browse through the items and states, I added a rowselection-event to the editorgrid, e.g. "beforerowselect" to load the states data when I browse through the grid. This is a very cool feature but it has one problem. If I want to edit a cell now, I need to double click it. It fires again 2 "beforerowselect" events. I also tryied with "rowselect" event, but it has the same behaviour.

Is there another event (maybe not documented) which only fires an event when it is really a new selection of a row?

I'm happy with any idea.

All the best
Luc

luc98
29 May 2007, 6:43 AM
hmm, any idea?
it does not work with rowselection event, nor with selectionchange event.

How can I store the current record id over an event? I just think of making an if to check whetere ther recordid ist the same when a rowselection or selectionchange event is fired.

Any idea?

jsakalos
29 May 2007, 10:35 AM
A workaround could be to remember the row number during first click handling and then check if that last row number equals this row number.

Or anybody else knows better?

luc98
30 May 2007, 3:05 AM
I did it like you described.
loadItemBriefing is the handler



loadItemBriefing : function(selectionModel) {
if (selectionModel.isIdSelected(Project.activeItemId)) {
// do nothing because row is already selected
} else {
Project.activeItemId = selectionModel.getSelected().data.id;
// do something the event is fired first
}

Not veery nice, but it works.
Greets Luc