View Full Version : Why does 'viewready' event on GridView not fire?

20 Nov 2011, 4:00 PM
Hi there,

Ext.define('MyController', {
'myGridView': {
selectionchange: this.someFunction <- WORKS!
viewready: this.selFirstRow
this.selFirstRow: function() {
console.log('this text is never seen...'); <- NEVER GETS FIRED

Am I missing something? Is this a bug in 4.0.7?

It says specifically in the api docs for this event "Fires when the grid view is available (use this for selecting a default row)."

Thanks in advance for any ideas!

20 Nov 2011, 4:41 PM
Your code sample contains a number of syntax errors so it's a little difficult to be sure exactly what's causing your problem.

Try inlining the handler to confirm the event definitely isn't firing. i.e.:

viewready: function() {

Is myGridView definitely the gridview and not the grid? The terminology is made more complicated by the MVC because in MVC parlance the grid would be considered a view, but this should not be confused with the dataview (also known as a view) associated with the grid.