Deleting last remaining row on kendo grid on the last page does not go to the previous page

4 posts, 0 answers
  1. Regis
    Regis avatar
    2 posts
    Member since:
    May 2013

    Posted 02 May 2013 Link to this post

    See video:
    http://screencast.com/t/pHdDhSg26X

    It also happens if for example you are on the the 3rd page and you set the grid with
    $('grid').data().kendoGrid.dataSource.data([the data])

    If the data has less rows then the current page, example, new data 10 rows and you are on page 3 of a grid with 5 rows per page, it says on page 3, which is blank because you have only 10 rows.


    Using latest as you can see on the video.
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2190 posts

    Posted 06 May 2013 Link to this post

    Hi Regis,

     
    Please note that current behavior is correct - the grid currently doesn't check if the current grid view contains no records to change the page and you should implement it using custom code. For example you can use the dataBound event of the dataSource to check if current view contains no records to move to the previous page.

    Also I would suggest to share your idea at Kendo UserVoice to allow other users vote for it. Most voted ideas are included in next KendoUI releases.

    e.g.:

    function onDataBound(e) {
        if (this.dataSource.view().length == 0) {
            var currentPage = this.dataSource.page();
            if (currentPage > 1) {
                this.dataSource.page(currentPage - 1);
            }
        }
    }

     Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Jesse
    Jesse avatar
    24 posts
    Member since:
    Aug 2013

    Posted 13 Nov in reply to Vladimir Iliev Link to this post

    I too am confident thousands of my users would find this default behavior to be confusing. It's not the typical behavior of a paged collection in any application I've ever used. Typically when the last item is deleted from a page, that page ceases to exist. Personally I would like to see this built-in.

    Thanks for posting with the video, Regis and thank you for the code example, Vladimir. 

  4. Stefan
    Admin
    Stefan avatar
    1394 posts

    Posted 15 Nov Link to this post

    Hello, Jesse,

    Thank you for the feedback it's highly appreciated.

    Also, I will link the feature request associated with this, so if more users find this thread, they can easily vote for it:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/7442932-deleting-last-remaining-row-on-kendo-grid-on-the-l

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top