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

Bug? Use PersistSelection with GroupPaging

3 Answers 45 Views
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Veteran
Iron
Nils asked on 02 Jul 2020, 12:19 PM

Hi everyone,

not sure if I found a bug or if i'm just doing it wrong.

What I try is to create a grid that is per default grouped with GroupPaging and has a checkbox selection column with PersistSelection.

However I only get a js error "Cannot read property 'undefined' of undefined" @init._restoreSelection (kendo.all.min.js:62).

I tried adding an Id field but it still doesn't work. Only changed error to "Cannot read property 'Id' of undefined".

If I remove the PersistSelection it works fine.

Html.Kendo().Grid<MyViewModel>()
                   .Name("myGrid")
                   .Columns(c =>
                   {
                       c.Select().Width(50);
                       c.Bound(x => x.Id).Hidden();
                       c.Bound(x => x.ArticleNo);
                       c.Bound(x => x.ArticleGroup).ClientGroupHeaderTemplate("<input class=\"k-checkbox groupSelect\" type=\"checkbox\"> #= value  #").Hidden();
                   })
                   .PersistSelection()
                   .ToolBar(t => t.Search().Text(Localizer.Lang_SearchInTable))
                   .Events(x => x.DataBound("eventMyGridDataBound"))
                   .DataSource(dataSource => dataSource
                                   .Ajax()
                                   .PageSize(50)
                                   .GroupPaging(true)
                                   .Group(x => x.Add(y => y.ArticleGroup))
                                   .Read("GridRead", "Article")
                                   .Model(m =>
                                   {
                                       m.Id(f => f.Id);
                                       m.Field(f => f.ArticleNo);
                                       m.Field(f => f.ArticleGroup);
                                   }))

 

Best Regards

Nils

3 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 06 Jul 2020, 12:46 PM

Hello Nils,

Thank you for taking the time to share this undesired behavior with us.

After consulting with the Development team I have logged this as a bug. Its progress can be tracked at the following links. If we come up with a workaround it will be also posted there: 

- Feedback portal: https://feedback.telerik.com/aspnet-mvc/1474918-grid-persistselection-does-not-work-when-grouppaging-is-enabled
- GitHub: https://github.com/telerik/kendo-ui-core/issues/5892


As a token of gratitude for reporting this, I have updated your Telerik points adding some.

Regards,
Nikolay
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Nils
Top achievements
Rank 1
Veteran
Iron
answered on 06 Jul 2020, 12:58 PM

Hello Nikolay,

thanks for the help, it's very much appreciated.

Regards,
Nils

0
Nikolay
Telerik team
answered on 08 Jul 2020, 09:41 AM

Hi Nils,

You are most welcome.

This thread will be closed now. Please do not hesitate to submit a new one if anything new arises.

Regards,
Nikolay
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Nils
Top achievements
Rank 1
Veteran
Iron
Answers by
Nikolay
Telerik team
Nils
Top achievements
Rank 1
Veteran
Iron
Share this question
or