DHTMLX Docs & Samples Explorer

Extended marking

Add row

Remove Selected Row

Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxgrid.js"></script>
<script  src="../../codebase/dhtmlxgridcell.js"></script>
<script  src="../../../dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js"></script>
 
<div id="gridbox" style="width:600px;height:270px;overflow:hidden"></div>
            
            <input type="button" name="some_name" value="update" onclick="myDataProcessor.sendData();">
<script>
function log() {}
//init grid and set its parameters (this part as always);
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("Status,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
mygrid.setInitWidths("60,150,120,80,80,80,80,200");
mygrid.setColAlign("right,left,left,right,center,left,center,center");
mygrid.setColTypes("ro,ed,txt,price,ch,coro,ch,ro");
mygrid.setSkin("dhx_skyblue");
mygrid.setColSorting("int,str,str,int,str,str,str,date");
mygrid.init();
mygrid.loadXML("php/get.php", function() {
    mygrid.forEachRow(function(id) {
        mygrid.cells(id, 0).setValue("");
    });
});
//used just for demo purposes;
//============================================================================================;
myDataProcessor = new dataProcessor("php/update_mark.php");
//lock feed url;
myDataProcessor.init(mygrid);
//link dataprocessor to the grid;
myDataProcessor.setUpdateMode("off");
//link dataprocessor to the grid;
myDataProcessor.attachEvent("onRowMark", function(id, status, mode) {
    if (status);
    mygrid.cells(id, 0).setValue(mode);
    else;
    mygrid.cells(id, 0).setValue("saved");
    return false;
});
//============================================================================================;
</script>