PDA

View Full Version : Selecting row in grid based on value



ajones86
23 Aug 2007, 2:06 AM
Hi,

I want to select a row in a grid based on the data in a column. I know that there is only one row that matches the data. How is the best way to do this? Is there a way I can loop through all the data in the grid until I find it, or is there an easier way to do this?

Thanks,
Andrew

Animal
23 Aug 2007, 2:20 AM
http://extjs.com/deploy/ext/docs/output/Ext.grid.Grid.html#getDataSource

return an http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html

If you know the id you want, you can get the http://extjs.com/deploy/ext/docs/output/Ext.data.Record.html for that row, otherwise, you'll have to use http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html#query or http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html#queryBy