PDA

View Full Version : Cell selection model not returning a selection.



castitas
16 Mar 2012, 11:28 AM
I have selType: 'cellmodel' on a grid. When I do grid.getSelectionModel().lastSelected() or grid.getSelectionModel.hasSelection(), it doesn't recognize the selection. It doesn't even have 'lastSelected'.

Why?
(and how can I tell what row is selected?)

mitchellsimoens
16 Mar 2012, 11:56 AM
In 4.1.0 RC1 I can do:


var model = grid.getSelectionModel(),
has = model.hasSelection(),
last = model.lastSelected;

has variable is true and the last variable is the record.

castitas
19 Mar 2012, 7:50 AM
Your code worked, but my problem is different.
When I run the code, has is false and lastSelected is undefined even though a cell is selected. (I'm getting the selection to get the model so I can activate a row editor)

After poking around a bit, I found that the 'selected' property of a cell selection model is never populated, getSelection() is always [], isFocused() is always false... I'm thinking that these functions only work on a row selection model.