Вопрос

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

Это было полезно?

Решение

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);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top