Can't Delete

Hi, i need some help…
I follow the steps to “Step-by-step building (“Contact manager” application)”
can add, update(from form, not inline edit), but not delete
take hours trying to figure out what is the problem but i can’t see it

gridMaterial.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Ingreso MaterialEquipo</title>
    <!-- dhtmlx.js contains all necessary dhtmlx library javascript code -->
    <script src="codebase/dhtmlx.js" type="text/javascript"></script>
    <script src="codebase/dhtmlxdataprocessor_debug.js" type="text/javascript"></script>dhtmlxdataprocessor_debug.js
    <script src="codebase/dhtmlxgrid_export.js" type="text/javascript"></script>
    <!-- dhtmlx.css contains styles definitions for all included components -->
    <link rel="STYLESHEET" type="text/css" href="codebase/dhtmlx.css">
    <style>
            /*these styles allow dhtmlxLayout to work in fullscreen mode in different browsers correctly*/
        html, body {
           width: 100%;
           height: 100%;
           margin: 0px;
           overflow: hidden;
           background-color:white;
        }
    </style>
    
    <div id="contenedor" style="width: 100%; height: 100%;"></div>
    
<script type="text/javascript">
    
function OnLoad(){
    
var layout,toolbar,mateqGrid,mateqForm,mateqFormData;
var mateqArray = new Array();
var i = 0;
dhtmlx.image_path = "codebase/imgs/";
    

    //Layout
    layout = new dhtmlXLayoutObject("contenedor","2U");
    
    layout.cells("a").setText("Material/Equipos");
    layout.cells("b").setText("Detalle");
    layout.cells("b").setWidth(200);
    
    //Toolbar toolbar.xml
    
    toolbar = layout.attachToolbar();
    toolbar.setIconsPath("icons/");
    toolbar.loadXML("recursos/toolbarMaterial.xml");
    
    function doBeforeRowDeleted(rowId) {
    if (confirm("Are you sure you want to delete row")) {
        
        return true;
    } else {
        
        return false;
    }
}
    //Grid
    mateqGrid = layout.cells("a").attachGrid();
    
    mateqGrid.setHeader("IdSerie,Marca,Modelo,Descripcion,Tipo,Cantidad,Estado");
    mateqGrid.setInitWidths("100,150,150,*,100,100,150");
    mateqGrid.setColAlign("left,left,left,left,left,right,left");
    mateqGrid.setColTypes("ed,ed,ed,ed,ed,ed,ed");
    mateqGrid.setColSorting("str,str,str,str,str,str,str");
    mateqGrid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#select_filter,#text_filter,#select_filter");
    mateqGrid.attachEvent("onBeforeRowDeleted", doBeforeRowDeleted);
    mateqGrid.init();
    mateqGrid.load("recursos/gridMaterial.php",function(){
        mateqGrid.forEachRow(function(id){

        //Color Material <=30 o Equipo <=4
    
        if ((mateqGrid.cellById(id,4).getValue()=="Material" && mateqGrid.cellById(id,5).getValue()<=30) || (mateqGrid.cellById(id,4).getValue()=="Equipo" && mateqGrid.cellById(id,5).getValue()<=4)){    
            mateqGrid.setCellTextStyle(id,5,"color: red");
        }else{
            mateqGrid.setCellTextStyle(id,5,"color: green");
        }

        });   
        
    });
    
    //DataProcessor para Grid
    var dpg = new dataProcessor ("recursos/gridMaterial.php");
    dpg.init(mateqGrid);      
    
    //Formulario ed
    mateqForm = layout.cells("b").attachForm();
    mateqForm.loadStruct("recursos/formMaterial.xml");
    mateqGrid.attachEvent("onRowSelect", function(rID,cInd){
            mateqForm.load("recursos/formMaterial.php?id="+rID);
    })
    
    //DataProcessor para Form
    var mateqFormData = new dataProcessor("recursos/formMaterial.php");
    mateqFormData.init(mateqForm);
    mateqFormData.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
            mateqGrid.cells(sid,0).setValue(mateqForm.getItemValue("idSerie"));
            mateqGrid.cells(sid,1).setValue(mateqForm.getItemValue("marca"));
            mateqGrid.cells(sid,2).setValue(mateqForm.getItemValue("modelo"));
            mateqGrid.cells(sid,3).setValue(mateqForm.getItemValue("descripcion"));
            mateqGrid.cells(sid,4).setValue(mateqForm.getItemValue("tipo"));
            mateqGrid.cells(sid,5).setValue(mateqForm.getItemValue("cantidad"));
            mateqGrid.cells(sid,6).setValue(mateqForm.getItemValue("estado"));
    });
    
            
    // Eventos
    mateqForm.attachEvent("onButtonClick", function(name, command){
            mateqFormData.sendData();
    });
    
    toolbar.attachEvent("onClick",function(id){
       if(id=="newProd"){
        //Popup
        var popupWindow = layout.dhxWins.createWindow("newagmat_win", 0, 0, 220, 470);
        popupWindow.center();
        popupWindow.setText("Agregar Material");
        //Form
        var newMaterialForm = popupWindow.attachForm();
        newMaterialForm.loadStruct("recursos/formMaterial.xml");
        var dpfs = new dataProcessor("recursos/formMaterial.php");
        dpfs.init(newMaterialForm);
        newMaterialForm.attachEvent("onButtonClick", function(name, command){
            dpfs.sendData();
        });
        dpfs.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
            if(action=="inserted"){
                dpg.ignore(function(){
                    mateqGrid.addRow(tid,[newMaterialForm.getItemValue("idSerie"),newMaterialForm.getItemValue("marca"),newMaterialForm.getItemValue("modelo"),newMaterialForm.getItemValue("descripcion"),newMaterialForm.getItemValue("cantidad"),newMaterialForm.getItemValue("tipo"),newMaterialForm.getItemValue("estado")],0)
                });
                mateqGrid.selectRowById(tid,false,false,true);
                popupWindow.close();
            }
        })
        } 
       
       else if(id=="delProd"){
            var selectedItem = mateqGrid.getSelectedRowId();
            mateqGrid.deleteRow(selectedItem);
       }
       
       else if(id=="expPDF"){
        mateqGrid.toPDF("http://dhtmlxgrid.appspot.com/export/pdf");
        // mateqGrid.toPDF('codebase/topdf/generate.php'); <-- php.ini error memory
       } 
       
       else if(id=="expXLS"){
        mateqGrid.toExcel("http://dhtmlxgrid.appspot.com/export/excel");
        // mateqGrid.toPDF('codebase/toxls/generate.php'); <-- error
       } 
       
       else if(id=="ayuda"){

       }  
        
        
    });
    
}  
 </script>
</head>
<body onload="OnLoad()" >
</body>
</html>

gridMaterial.php

<?php
	require("../codebase/connector/grid_connector.php");
	$res=mysql_connect("localhost","root","12345");
    mysql_select_db("inventario");
 
	$gridConn = new GridConnector($res,"MySQL");
	$gridConn->render_table("tblmaterial","idSerie","idSerie,marca,modelo,descripcion,tipo,cantidad,estado");
?>

Debug

Current state
 ID:12341 Status: deleted, valid
Current mode: cell
 Log:
 row 1346137684738 marked [inserted,valid]
 row 12341 marked [updated,valid]
 row 12341 marked [deleted,valid]
 Initiating data sending for 12341
 Sending in one-by-one mode, current ID = 12341
 Server url: recursos/gridMaterial.php parameters
 Server response received details

details:
<?xml version='1.0' encoding='utf-8' ?><rows><row id='10001'><cell><![CDATA[10001]]></cell><cell><![CDATA[Marca]]></cell><cell><![CDATA[Modeloa]]></cell><cell><![CDATA[Descripcion blabla]]></cell><cell><![CDATA[Equipo]]></cell><cell><![CDATA[1]]></cell><cell><![CDATA[OK]]></cell></row><row id='100FE2'><cell><![CDATA[100FE2]]></cell><cell><![CDATA[Marca2]]></cell><cell><![CDATA[Modelo2]]></cell><cell><![CDATA[asdfasdf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[2]]></cell><cell><![CDATA[Baja]]></cell></row><row id='10E40A'><cell><![CDATA[10E40A]]></cell><cell><![CDATA[Marca4]]></cell><cell><![CDATA[Modelo34]]></cell><cell><![CDATA[Descripcion balbasdfajdfkj]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[500]]></cell><cell><![CDATA[OK]]></cell></row><row id='324E40'><cell><![CDATA[324E40]]></cell><cell><![CDATA[Marca4]]></cell><cell><![CDATA[Modelo23]]></cell><cell><![CDATA[Descserji casdn fadsf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[4]]></cell><cell><![CDATA[OK]]></cell></row><row id='100DS'><cell><![CDATA[100DS]]></cell><cell><![CDATA[Marca234]]></cell><cell><![CDATA[ElModelo]]></cell><cell><![CDATA[safdsaf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[3000]]></cell><cell><![CDATA[OK]]></cell></row><row id='100SD'><cell><![CDATA[100SD]]></cell><cell><![CDATA[Maarca]]></cell><cell><![CDATA[MOoodelo]]></cell><cell><![CDATA[adsfalkjf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[2050]]></cell><cell><![CDATA[OK]]></cell></row><row id='42341234'><cell><![CDATA[42341234]]></cell><cell><![CDATA[asdfasdf]]></cell><cell><![CDATA[asdfadsf]]></cell><cell><![CDATA[laksdjflkajdsf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[2405]]></cell><cell><![CDATA[OK]]></cell></row><row id='213423'><cell><![CDATA[213423]]></cell><cell><![CDATA[dsfs]]></cell><cell><![CDATA[adsfasdfa]]></cell><cell><![CDATA[asdfa]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[2343]]></cell><cell><![CDATA[OK]]></cell></row><row id='2542'><cell><![CDATA[2542]]></cell><cell><![CDATA[adsfas]]></cell><cell><![CDATA[asdf]]></cell><cell><![CDATA[adsfasdf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[1234]]></cell><cell><![CDATA[OK]]></cell></row><row id='12341'><cell><![CDATA[12341]]></cell><cell><![CDATA[adfsa]]></cell><cell><![CDATA[adsf]]></cell><cell><![CDATA[asdf]]></cell><cell><![CDATA[Material]]></cell><cell><![CDATA[234]]></cell><cell><![CDATA[OK]]></cell></row></rows>

thaankss for any help!!! (i don’t speak english! xD!)

Try to include connector.js on the page, after dhtmlx.js

<script src="codebase/dhtmlx.js" type="text/javascript"></script>
<script src="codebase/connector.js" type="text/javascript"></script>

THANKS YOU!!!

i added

<script src="codebase/connector/connector.js" type="text/javascript"></script>

now its working!!! (in some tutorials just sais add dhtmlx.js from the suite standar to work)

thanks a lot!!! :smiley: