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

Grid Default Group

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
brett
Top achievements
Rank 1
brett asked on 13 Jan 2016, 11:40 PM

Hello, 

I'm new to Kendo and been working on Grids.
I set up a grid with grouping but, I need to set a default group.

I have these headers year, type, id, title, date and I will want the default group to be by type.

 I seen a few ways on the site to do it by JS but, is there an easier, php way to do this maybe through addColumn -> datasource or by $grid->dataBound.

 Thanks a lot, 

Brett

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 15 Jan 2016, 02:31 PM
Hi Brett,

I would recommend checking the Grid Aggregates PHP example as well as the DataSource documentation.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
brett
Top achievements
Rank 1
answered on 15 Jan 2016, 03:53 PM

Thanks a lot, the aggregates works. 

My code for anyone else. 

$dataSource = new \Kendo\Data\DataSource();
$group = new \Kendo\Data\DataSourceGroupItem();
   $group->field('type'); 

         $dataSource->data($content)->addGroupItem($group);

 

Tags
Grid
Asked by
brett
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
brett
Top achievements
Rank 1
Share this question
or