1. #21
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    ok, my problems were due to it being a remote grid, have to call the Aggregate function on the datastore load event
    it should also be known that getRowClass will likely break for most people when used with this as well; it fires for the aggregate row too (which has a different data property than the normal rows).
    the only other issue i am seeing so far is that a paging bar displays "record 1 - 10 of 9" when 9 records are loaded. not a big issue, and i am sure i will be able to find the right function to override eventually.

  2. #22
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    on second thought, this isnt gonna be so easy, many of the internal store functions rely on records.length, which is off by one after the aggregate row is inserted.
    *sigh*

  3. #23
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    I feel like this thread belongs to me now
    PHP Code:
    /*
     * override the paging toolbar info display so it is
     * not off by one from the aggregate row being present
     */
    Ext.PagingToolbar.prototype.updateInfo = function(){
            if(
    this.displayEl){
                var 
    count this.ds.getCount();
                            if (
    this.ds.hasAggregatecount--;
                var 
    msg count == ?
                    
    this.emptyMsg :
                    
    String.format(
                        
    this.displayMsg,
                        
    this.cursor+1this.cursor+countthis.ds.getTotalCount()    
                    );
                
    this.displayEl.update(msg);
            }


  4. #24
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Vote Rating
    5
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    i'm still here

    I thought about remote store too. Sure, this aggregate row has to come from external script.
    But I think this row could be sent in meta-dates, not in the datarows themself. If you use the totalProperty this will be used, the root is defined for Data, one additional array can hold the aggregate array.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #25
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    To be honest, i nabbed this code because it sounded similar to what I really want to do: add a filter row at the top of the grid (i really dont like the context menu filters). And it has helped me understand alot about the grid. In the process of learning, I happened to notice some of these problems and of course had to figure out a way to fix them, so why not share the code back.
    Currently I am generating my aggregate/stats data on the backend and displaying them in seperate markup, mostly because I need stats for the entire record set which only the backend has access to in a paging grid.
    you idea of pulling the data from an external function (via another xrh call most lilely) is interesting, and may work for some people in my situation. The type of stats needed for my application doesnt lend itself well to be displayed inline though.
    I will continue posting anything I learn about
    am also using what I am learning to attempt to implement an editorGrid that works with an entire row at a time...

  6. #26
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Vote Rating
    5
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    ok - i will try to extend the existing sample with remote data and paging. Let's see what is the next problem
    May be we get a solution that is flexible enough to work in any situation.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  7. #27
    Ext User violinista's Avatar
    Join Date
    Apr 2007
    Location
    Serbia
    Posts
    293
    Vote Rating
    0
    violinista is on a distinguished road

      0  

    Default


    I still believe that the best place for stats/aggregating data in grid is on grid footer. It stays always on the screen, even you sort/page etc. I am close of finishing my solution, just have to handle column relocation and will post it here.
    "It is better to be young, pretty and rich instead old, ugly and poor."
    (c) Alan Ford.

  8. #28
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Vote Rating
    5
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    fine

    Whats about paged grids - should aggragate show the aggregate of visible data or of complete data ?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  9. #29
    Ext User violinista's Avatar
    Join Date
    Apr 2007
    Location
    Serbia
    Posts
    293
    Vote Rating
    0
    violinista is on a distinguished road

      0  

    Default


    My opinion is that grid have to show aggregate of all data by default - it would be good to make this option selectable - whether to show aggregate for only visible page, or all

    cheers
    "It is better to be young, pretty and rich instead old, ugly and poor."
    (c) Alan Ford.