Clear grid ClientFooterTemplate

3 posts, 0 answers
  1. Michael
    Michael avatar
    66 posts
    Member since:
    Dec 2009

    Posted 22 Feb 2014 Link to this post

    Hello,

    I currently have a clear grid button and the following code clears the rows from the grid:

    $("#studentGrid").data('kendoGrid').dataSource.data([]);

    But my problem is, I have a ClientFooterTemplate with totals.  How do I clear the ClientFooterTemplate in a javascript call?  I could do it on the DataBound event, but just don't know how to clear that footer.

    Thanks...
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 26 Feb 2014 Link to this post

    Hi Michael,

    The MVC Wrappers generate a DataSource that uses server operations by default, meaning that the aggregates are calculated on the server, so even if you clear the Grid's data the aggregates will not change until the data is synchronized. In the current scenario I would recommend disabling the server operations. Once you do that the aggregates will be calculated client-side, so if you set the data to an empty array then the total will become zero.

    Regards,
    Alexander Popov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Michael
    Michael avatar
    66 posts
    Member since:
    Dec 2009

    Posted 02 Mar 2014 Link to this post

    Thanks, works great!
Back to Top