Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Newbie need help!!!

  1. #1

    Default Newbie need help!!!

    I know this is a newbie's question, but I am really bumping my head with it.
    I have a page with the button that will load data to a grid.
    The grid's columns are sortable. The data is ordered from database.
    From the UI, clients are able to sort data by themselves.
    Now, the requirements is that every time clicking the upper "refresh" button
    it shall reload the data with the order from database.
    But it seems doesn't work out for me since it keeps the remain sorting order from the UI.
    This is my method to solve the problem
    Code:
    listeners: {
    click: function() { 
    storeEG.load();
    Ext.getCmp('tempField').removeAll(true);
    Ext.getCmp('tempField').add(new Ext.grid.GridPanel({
    id: 'display',
    store: storeEG,
    cm: colModel
    }));                    
    resizing();                    
    Ext.getCmp('tempField').doLayout();
    }
    }
    If you have any problems reading my code, please let me know.
    I simply create a 'fielset', then removing everything before reloading.
    Please spend kindly assist me with this problem.
    Thank you very much

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I assume that your store is not configured with remoteSort:true?

    In that case you simply need to remove the sortInfo (or multiSortInfo), e.g.
    Code:
    delete store.sortInfo;
    store.load();

  3. #3

    Default

    Quote Originally Posted by Condor View Post
    I assume that your store is not configured with remoteSort:true?

    In that case you simply need to remove the sortInfo (or multiSortInfo), e.g.
    Code:
    delete store.sortInfo;
    store.load();
    hi, Condor
    Thank you for your quick reply,
    I haven't tried to remove the sortInfo
    but I configured the remoteSort:true as you had mentioned
    the result from that is when the client sort manually,it doesn't turn out as the normal way
    Would you mind giving me a short explanation on how does this work out?
    I am really appreciated for your time.

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    A store has 2 sort modes, local and remote.

    1. In local mode the store uses the sortInfo (or multiSortInfo) to sort the data itself.
    2. In remote mode the store sends 'sort' and 'dir' parameters with the load and expects the server to return the records in the correct order.

    It looks like you want local mode (remoteSort:false), but you want to remove the sortInfo before loading.

  5. #5

    Default

    thanks,
    Just another question, is there anything like "store.sortInfo.remove"?
    I am finding it for a while but couldn't get any hints.

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Didn't you look at post #2?

  7. #7

    Default

    sorry, my bad
    but even i tried something like below as in my code
    Code:
    delete storeEG.sortInfo;
    storeEG.load();
    the refreshed-again-result still doesn't come out as same as database after the manual sorting
    sorry for my bad English if it sound vague

  8. #8
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    1. Is storeEg a normal Store or a GroupingStore?
    2. Is your server sending metaData with sortInfo together with the data?

  9. #9

    Default

    1/It is the normal store. this is how i wrote the store
    Code:
    var storeEG=new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({ method: 'post',url: 'rPages/rEgsitting.aspx?m=egcomb' })        
    ,reader: gridJson
    });
    2/Not really sure about the term "metaData", but the sortInfo does come together with the data since the store procedure
    from DB write "ORDER BY..."

  10. #10
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    If you don't know what metaData is then you are definately not using it.

    Strange... In that case this should really work:
    Code:
    delete storeEG.sortInfo;
    delete storeEG.multiSortInfo;
    storeEG.load();

Page 1 of 2 12 LastLast

Similar Threads

  1. NewBie
    By yoyon in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 7 Jan 2010, 5:06 AM
  2. js newbie..help on this!
    By mistress_shiira in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 15 Nov 2007, 11:34 PM
  3. newbie, need help
    By swamyveera in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 23 Oct 2007, 12:36 AM
  4. Newbie Help
    By fernando in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 1 Sep 2007, 3:28 AM
  5. Newbie help
    By Robb__ in forum Community Discussion
    Replies: 4
    Last Post: 15 Apr 2007, 11:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •