This is a migrated thread and some comments may be shown as answers.

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

3 Answers 582 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Regis
Top achievements
Rank 1
Regis asked on 02 May 2013, 03:21 PM
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.

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 06 May 2013, 11:15 AM
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!
0
Jesse
Top achievements
Rank 1
Veteran
answered on 14 Nov 2017, 03:24 AM

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. 

0
Stefan
Telerik team
answered on 15 Nov 2017, 11:41 AM
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.
Tags
Grid
Asked by
Regis
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Jesse
Top achievements
Rank 1
Veteran
Stefan
Telerik team
Share this question
or