1. #11
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I like this method:
    Code:
    App.G1 = Ext.extend(Ext.GridPanel, {
      constructor: function(config){
        App.G1.superclass.constructor.call(this, Ext.apply({
          store: ...
          ...
        }, config));
      },
      ...
    });
    App.G2 = Ext.extend(App.G1, {
      constructor: function(config){
        App.G2.superclass.constructor.call(this, Ext.apply({
          store: ...
          ...
        }, config));
      },
      ...
    });
    (but you could also keep your current code, but check in G1 initComponent if a store already exists before assigning a new one)

  2. #12
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    But condor, I think problem is due to event. As I mentioned in my starting comments, In parent Grid, I have registered 'sortchange' event which call doSorting funtion which actually makes server call.

    So, in child panel, when I click on grid column (for sorting), it calls parent doSorting method as I have not implemented in Child panel.

    But when I override doSorting function in child panel with empty function, default sorting behavior stopped.

    So, I want to know how to prevent parent method calling and preserve default sorting behavior.

  3. #13
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    No, that's not your problem.

    Your actual problem is that G2 is still using the store defined in G1 instead of the one in G2, because the G1 initComponent replaces the store.

  4. #14
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    I have put checking in parent grid and now it creates grid store if not exists. But, still problem exists.

    I have put log in doSorting method. As I told you, in doSorting method, server call is hapening.

    When I click on column for sorting in child panel, it call doSorting method of parent which actually should not.

    I have overridden doSorting method in child panel with Ext.emptyFn so it doesnt call parent method but default local grid sorting not working. So, how to resolve it?

  5. #15
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    "doSorting"? GridPanel doesn't have a doSorting method.

    What method did you actually override?

  6. #16
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    doSorting is method which I have created in parent panel GP1 and calling on sortchange event registered like below

    Code:
    this.on('sortchange', this.doSortChange, this);
    Now, I am extending GP1 in GP2 (child panel). So, on sortchange event of child panel, it calls doSorting method of parent and this method fires AJAX server request which I dont want.

    So, I am overriding this method in GP2 by Ext.emptyFn so now parent doSorting method not called but local grid sorting stop to work. I mean when I click column in GP2, nothing happens instead of sorting of rows.

    I think now I am cleared

  7. #17
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Setting doSortChange to Ext.emptyFn should have not effect on the actual sorting. Something else must be cause the problem.

  8. #18
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    Yes..you are right condor..

    I have checked that one and problem is not due to that.

    So, what can be the possible causes of this problem? I have checked each and everything according to my knowledge and nothing seems problematic. So, what can be the issue?

  9. #19
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Could you post your current code and an exact description of what is going wrong?

Similar Threads

  1. Go direct to proxy and avoid sync() batching
    By termy21 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 26 Dec 2010, 10:06 AM
  2. GRID PANEL WHIT 100% OF DIV PARENT
    By fhuggler in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 21 May 2010, 3:37 PM
  3. Proxy undefined by changing the page in grid panel
    By diablo in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 13 Jan 2010, 3:29 AM
  4. grid parent container on a form panel
    By jeremy.hennegrave in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 30 Apr 2008, 5:14 AM
  5. Grid Panel to fit in Parent witdh scroll bars
    By karel-jan in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 15 Apr 2008, 6:10 AM

Thread Participants: 1