Hi im working with dhtmlx and I have a gridview, i want that the column type change sometimes in differents rows
heres is the code where i load the grid
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();
and here is where i wanna change the column type
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]);
}
}
if you get inside of the first if i wanna do mygrid.setColTypes("coro,txttxt,dyn") else mygrid.setColTypes("coro,coro,dyn")
You may change the type of any cell in your grid dynamically using the setCellExcelltype() method: https://docs.dhtmlx.com/api__dhtmlxgrid_setcellexcelltype.html