سؤال

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