locked
Accessing Model in nested Webgrid footer? RRS feed

  • Question

  • User-1796506859 posted

    Hi Folks,

    I have a nested jQuery webgrid with a custom footer to be displayed at the bottom of the nested grid (basically column totals).   The nested get uses the .Table() method rather than getHtml() and the footer displays nicely.  

    The issue that I am having is I cannot seem to access the model used by the subgrid from the footer.  The parent grid uses Model.ReportDetails  and the subGrid uses item.SubDetails  (effectively Model.ReportDetails[index].SubDetails.

    When I access  @item in teh subgrid, it points to Model.ReportDetails, not SubDetails,  which means I dont know which element in the collection I am currently using.

    // I Want something like..
    ,footer: (ft) => {   var i = ft.MyColumnTotal(); ....
    
    // But get something like...
    ,footer: (ft) => {  ft is null, item points to parent webgrid.  how to get correct item[index].MyColumnTotal();  as index is unknown }
    
    

    Tuesday, September 26, 2017 8:47 PM

All replies

  • User1771544211 posted

    Hi AndyW2009,

    Could you please share the complete code of the webgrid and subgrid here?

    Best Regards,

    Jean

    Wednesday, September 27, 2017 7:06 AM