PDA

View Full Version : Select All Rows from a grid



Tumac
23 May 2010, 9:44 AM
I have a function for a button on a master/detail form that when pressed will update all detail records.

Right now it works if you select all the records in the grid by clicking on the record.

I want to automatically select all records when I press the button instead of having to select them manually.


,onConvert : function() {
var detailGrid = this.getComponent('tallyGrid');
var records = detailGrid.getSelected(); <---- I WANT TO REPLACE THIS WITH A METHOD TO SELECT ALL AUTOMATICALLY
if (records) {
this.fireEvent('convertStock', records, detailGrid, this);
}
}

I tried detailGrid.selectAll(); but that is not valid

Thanks in advance for any insight

steffenk
23 May 2010, 9:50 AM
grid.getSelectionModel().selectAll()

You should use the documentation.