How to correctly save the group after a reboot?

There is a table kendogrid works fine, but is not retained group after reboot. Tried to save in the form of cookies

A function to collect groups
onGrouping function(arg) {
group=kendo.stringify(arg.groups);
 $.cookie('group', group);
 var str = $.cookie("group");
 console.log("group = "+$.cookie("group"));
}


here that prescribed in table

dataSource:
{ 
 data: data.data
 serverSorting: true,
 sort: { 
 shield: field, dir: dir 
 }, 
 group: $.cookie("group"), 
pageSize:20
},
group: onGrouping,


the group appears crooked
5e1d8b5b9fd00442252768.png
April 4th 20 at 01:54
1 answer
April 4th 20 at 01:56
group: onGrouping,
tried to remove?
and so tried?:
dataSource:
{ 
 group: $.cookie("group"), 
 data: data.data
 serverSorting: true,
 sort: { 
 shield: field, dir: dir 
 }, 
 pageSize: 20,
},
From onGrouping I just take the group and put it in cookies. - Cale.Schmi commented on April 4th 20 at 01:59
In the browser console $.cookie("group") produces any output? - Julia_Schiller commented on April 4th 20 at 02:02
onGrouping function(arg) {
group=kendo.stringify(arg.groups);
 $.cookie('group', group);
 var str = $.cookie("group");
 console.log("group = "+$.cookie("group"));
}

Damn it, of course.
You need to call the function onGrouping before, otherwise You have the $.cookie("group") is empty. - Julia_Schiller commented on April 4th 20 at 02:05
@Julia_Schiller, issues all right, but the feeling that he perceives as a string and not as a parameter.

5e1ed657c4c78059644407.png - Cale.Schmi commented on April 4th 20 at 02:08
dataSource:
{ 
 data: data.data
 serverSorting: true,
 sort: { 
 shield: field, dir: dir 
 }, 
 group: $.cookie("group"), 
pageSize:20
},
group: onGrouping,


Well, here it is clear that onGrouping is called the second parameter. Consequently group: $.cookie("group") is empty.

What's the dataSource:
{
data: data.data
server - Julia_Schiller commented on April 4th 20 at 02:11
@Julia_Schiller, moved the effect is the same - Cale.Schmi commented on April 4th 20 at 02:14
@Cale.Schmi, logical, because it is not activated - Julia_Schiller commented on April 4th 20 at 02:17
You probably so? don't know how true that is, invite expert.

onGrouping(dataSource:
{
data: data.data
serverSorting: true,
sort: {
shield: field, dir: dir
},
group: $.cookie("group"),
pageSize:20
}); - Julia_Schiller commented on April 4th 20 at 02:20

Find more questions by tags jQueryKendo UI