Grid Default Group

3 posts, 1 answers
  1. brett
    brett avatar
    2 posts
    Member since:
    Dec 2015

    Posted 13 Jan Link to this post

    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. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 15 Jan Link to this post

    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!
     
  3. UI for ASP.NET AJAX banner
  4. brett
    brett avatar
    2 posts
    Member since:
    Dec 2015

    Posted 15 Jan Link to this post

    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);

     

Back to Top