html - Kendo Grid Row Grouping Not Working -


i using kendo first time , attempting convert html table kendo grid. upon initialization, want table grouped specific column , not groupable other column. below contrived example of table of cars grouped car's make demonstrates how attempting group specific column upon initialization.

this attempt not cause table grouped. know kendogrid call working, because if set groupable true able group column via drag , drop, initial grouping still not occur. suspect somehow group field "make" not being tied make column, examples i've seen seem indicate can accomplished using data-field have done.

<table id="carsgrid">     <thead>         <tr>             <th>year</th>             <th>color</th>             <th data-field="make">make</th>          </tr>     </thead>     <tbody>         <tr>             <td>2010</td>             <td>red</td>             <td>dodge</td>         </tr>         <tr>             <td>2014</td>             <td>blue</td>             <td>ford</td>         </tr>         <tr>             <td>2016</td>             <td>black</td>             <td>dodge</td>         </tr>        </tbody> </table> 

and in document's ready function:

$('#carsgrid').kendogrid({     datasource: { group: { field: "make" } },     groupable: false //i not want grouping on other columns }); 

i found solution problem: check example http://dojo.telerik.com/oheta

you should add data-groupable="false" attribute in <th> element:

 <thead>      <tr>         <th data-field="year" data-groupable="false">year</th>         <th data-field="color" data-groupable="false">color</th>         <th data-field="make">make</th>      </tr>  </thead> 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -