2015-07-13 140 views
-2
columns: [ 
      { 
       data: 'ch', 
       type: 'checkbox', 
       checkedTemplate: 'yes', 
       uncheckedTemplate: 'no' 
      }] 

如果你想这样的复选框..你可能会认为选择具有obj.setDataAtCell(row, col, "yes");选择所有复选框

回答

-2

所有复选框,但这种方式很慢..所以我找到了伟大的方式,以最快的方式直接访问数据对象。并且呈现数据

function checkAll(x) { 
    if(x) { 
     for(i=0; i<gh.getData().length;i ++) 
      console.log(gh.getData()[i].ch = "yes"); 
    } else { 
     for(i=0; i<gh.getData().length;i ++) 
      console.log(gh.getData()[i].ch = "no"); 
    } 
    gh.render(); 
} 

感谢