문제

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