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

collapse group

0 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jana
Top achievements
Rank 1
Jana asked on 09 Dec 2011, 08:17 PM
I have looked through all the examples and tried many iterations and am unable to get my groups to collapse.
var localDataSource = new kendo.data.DataSource({
               data: skills,
               schema: {
                   model: {
                       fields: {
                           CatId: { type: "number" },
                           SkillCat: { type: "string" },
                           Skill: { type: "string" },
                           IsCorrect: { type: "string" }
                       }
                   }
               }
  
           });
           var grid = $("#grid").kendoGrid({
               dataSource: localDataSource,
               columns: [
                   { field: "Skill" },
                   { field: "IsCorrect" }
                   ],
               height: 470,
               pageable: true,
               scrollable: true,
               dataBound: function () {                  
                   localDataSource.group({ field: "CatId" }); 
                   grid.collapseGroup(grid.tbody.find(">tr.k-grouping-row:first"));
                   for (i = 1; i <= 6; i++) {
                       grid.collapseGroup(grid.tbody.find(">tr.k-grouping-row").eq(i));
                   };                    
               }
           });

I also need to have my group headers changed to SkillCat value. Can I do this with templates? I haven't tried that yet.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Jana
Top achievements
Rank 1
Share this question
or