PDA

View Full Version : How to select a grid group header in Extjs4.2



url
2 Aug 2013, 5:23 AM
Hi All,
I have a grouping grid in my application, where for one group we are showing data and for other type just showing the group header.


Based on the requirement am selecting the record. My requirement is the selected record should be in focus.


For this am getting the record and store and for those group have rows available I'm able focus them with grid.getView().focusRow(selected);
But for the second group(where we are not showing the child items), grid.getView().focusRow(selected); is not focusing the record.


Is there any way to focus the grid group header, so that I can use the same.

Thanks
Url

url
3 Aug 2013, 6:26 AM
Hi All,
I got solution.
First we need to get the required grid group header element, and grid view elemnt and by scrollIntoView() we can be able to focus the group.


var headerElement = Ext.select('.x-grid-row-selected').elements[0];
headerEl.scrollIntoView(grid.getView().el);


Thanks
Url

Gary Schlosberg
4 Aug 2013, 6:56 AM
Glad to hear you got it working, and thanks for posting your solution for everyone.