我正在使用dhtmlx并且我有一个gridview,我希望列类型有时会在不同的行中更改
heres是我加载网格的代码
mygrid = new dhtmlXGridObject('gridbox');
mygrid.imgURL = "/dhtmlxGrid/sources/imgs/";
mygrid.setHeader("Tipo,Actividad,Cantidad", null, ["text-align:center;","text-align:center;","text-align:center;","text-align:center;"]);
mygrid.attachHeader("#numeric_filter,#text_filter,#text_filter,#numeric_filter");
mygrid.setSkin("dhx_web");
mygrid.setInitWidths("100,200,300,75")
mygrid.setColTypes("coro,txttxt,dyn");
mygrid.setColAlign("left,left,right");
mygrid.setColSorting("str,str,int");
mygrid.enableBlockSelection();
mygrid.enableMultiline(true);
mygrid.init();
这里是我要更改列类型的地方
function agre_regi()
{
if(document.getElementById("cmbCata_repo").value == 5 || document.getElementById("cmbCata_repo").value == 6)
{
mygrid.addRow(mygrid.getRowsNum()+1,[document.getElementById('cmbCata_repo').value,document.getElementById('txtCausas').value,document.getElementById('txtCantidad').value]);
}else
{
mygrid.addRow(mygrid.getRowsNum()+1,[document.getElementById('cmbCata_repo').value,cmbActividad.getSelectedText(),document.getElementById('txtCantidad').value]);
}
}
如果你进入第一个,如果我想做mygrid.setColTypes(" coro,txttxt,dyn") 其他 mygrid.setColTypes("科罗,科罗,DYN&#34)
答案 0 :(得分:1)
您可以使用setCellExcelltype()方法动态更改网格中任何单元格的类型: https://docs.dhtmlx.com/api__dhtmlxgrid_setcellexcelltype.html