PDA

View Full Version : Ext.grid.GridPanel fires rowselection when sorting grid



RoyalSouvenir
11 Jun 2009, 4:02 AM
Hi All,
First time caller, long time listener here.

I have a grid which fires a function to add a tab via row selection. The code is adapted from the examples supplied when downloading ext. I have the following function which creates a new tab



function addTab(){
var strTitle = 'Ticket';
tabs.add({
title: strTitle,
html: 'Blah',
closable:true
}).show();
}


I call this via;


grid.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {
addTab();
});


This works fine however what happens is that after I make a selection which creates a new tab, attempting to sort the grid (via the default sort options) fires grid.getSelectionModel again thereby rendering the sorting functionality useless. This only happens after I have selected a row. The grid will sort ok before I select a row.

I am fairly inexperienced with ext so any help would be appreciated.

My grid is using a GroupingStore but the same thing happens with a normal store.

Regards,
Cameron

RoyalSouvenir
11 Jun 2009, 4:03 AM
Please ignore. I'm using 2.1 so I will re-post to the correct forum.