Pregunta

I have a grid panel which contains a function definition too:

    var s_grid= new Ext.grid.GridPanel ({
    ...
    ......
    addRow:function(organizationId,name,coreNumber) {
        ........
        Ext.getCmp("s_grid").getView().focusRow(i);
        .......
  }
 });

Is there a better way for the function object to refer to its parent;rather than doing a iteration over the entire Ext domian as in the code?
I am using ExtJs 3.4

¿Fue útil?

Solución

If the function is defined in your grid configuration, the grid will be the function's scope anyway, so you should be able to access it using this:

this.getView().focusRow(i);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top