PDA

View Full Version : attaching event to grid row?



benny
19 Apr 2007, 12:32 AM
Hi,

Just found ext yesterday, so obviously not had a lot of time to play with it yet.

Q: On a grid, is it possible to attach a onClick or onFocus event to a row?

(I have a grid loaded to the center of the complex layout [one of the examples], I hope to load data to the 'east' region which will relate to the selected row.)

I have another question which is very similar to the first.... can I add linked icon/images to a cell? (for example, a edit, update, delete, view full options!)

I do intend to read all the docs, btw!

Many Thanks

Animal
19 Apr 2007, 1:10 AM
Images in cells is a FAQ, do a search. You need a custom renderer on that Column which returns "<img src='foo'>"

For events, see the docs like

http://extjs.com/deploy/ext/docs/output/Ext.grid.RowSelectionModel.html#event-rowselect

and

http://extjs.com/deploy/ext/docs/output/Ext.grid.Grid.html#event-rowclick

benny
19 Apr 2007, 2:36 AM
thank you Animal - you has saved me some time!