[CLOSED] Cloning store or executing store proxy without modifying store data

  1. #1

    [CLOSED] Cloning store or executing store proxy without modifying store data

    Hello

    Let's start with this example as it is https://examples4.ext.net/#/GridPane.../DirectMethod/

    now I would like to add button that would execute Ajax ( diret) request and return me all the data from the server ( means all pages),
    and in the same time grid will stay as it is ( so still paged). Is something like that possible?


    Motivation behind - Exporting to excel ( yes I know you have samples for that but they do not follow client side columns format)
    I have a function that send column model and grid data to the server. Based on this information it relativelly inteligently ( sure limitations present) export the same data to excel as client see (so for example dates are formated as dates, numbers as numbers according Format property of column etc.) Now my last problem - if grid is paged I do not have all the data on client. My Users would like to see all pages in export (they are fine to wait for that).

    Ideally if I can clone grid store, execute it's load method, load all pages, execute my export functionality.
    Alternativelly from store proxy retrieve (asychronously ) data

    Is somethign like that doable?

    Thanks
    Zdenek
    Last edited by fabricio.murta; Oct 05, 2016 at 8:48 PM.
  2. #2
    Hello @zdenek!

    As for what you're saying, why doesn't remote data with local (client side) paging work for you? If your requirements are just have the data loaded from server entirely and paged on client side, I can't see the problem in it. But maybe I didn't get the "do not follow the client side columns format" part of your message.

    Example, just in case: GridPanel - Local Data Paging with Remote Data
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello

    Local Paging with remote data does not work because in this grid is supposed to be a lot of records (like thosands)
    user will be warned if he will try to export all of them, but typically he will add some filters after while and export just few hundreds

    Just repeating again - I want to load all pages only for export. What is in the page should stay as it is
  4. #4
    Hello @Zdenek!

    I can't think on a solution better than local and remote paging, then, like in this example you probably already looked: Local paging with remote data.

    Something that may somehow be worth the while understanding is this chained example in Mobile Examples explorer that I'm pretty confident that it could be ported to Ext.NET with reasonable effort: Data Binding - Chaining Stores.

    But maybe the best option for you to attain this is force the users to provide the filter beforehand, and only then pull the data. A good side effect of this behavior is that you could add a feedback on how many records the filter will be loading before the user effectively loads the data (which depending on the filter could just bring too much information and bring poor performance).
    Fabrício Murta
    Developer & Support Expert
  5. #5
    "forcing users" is usually not a solution in our case :-)

    anyway , I solved loading of data by

    var store = grid.store;
    var proxy = store.proxy;
    
    var directMethod = proxy.directFn;
    
    directMethod = eval(directMethod);
    
    var extraParams = Ext.clone(proxy.extraParams);
    if (store.lastOptions.sorters.length > 0) {
    	extraParams.sort = '[' + Ext.encode(store.lastOptions.sorters[0].config) + ']';
    	extraParams.start = 0;
    	extraParams.limit = Math.pow(2, 30);
    }
    directMethod('read', extraParams,{complete:function(success,data){
     // full grid data
    }};
    which seems to work for me
  6. #6
    Hello @Zdenek!

    Glad you could find a solution for your case, and thanks for sharing the outcome!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Store : Loading mask when store load with AJAX proxy
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 15
    Last Post: Feb 27, 2015, 3:55 PM
  2. Replies: 5
    Last Post: Feb 05, 2015, 12:14 PM
  3. Replies: 3
    Last Post: May 06, 2013, 11:52 AM
  4. Replies: 9
    Last Post: Oct 16, 2012, 12:05 AM
  5. [CLOSED] Load data to store of combobox by proxy
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 08, 2012, 8:29 AM

Posting Permissions