| Sample: dhtmlxGrid | Attaching Event Handlers | dhtmlxGrid main page |

Control grid processing and user behaviour using Grid Event Handlers available through Javascript Methods

Remove Selected Row
Protocol:

    <div id="gridbox" width="100%" height="250px" style="background-color:white;overflow:hidden"></div>
    <script>
            function doOnRowSelected(id){
                ...
            }
            function doOnCellEdit(stage,rowId,cellInd){
                if(stage==0){
                    ...
                    return true;
                }else if(stage==1){
                    ...
                }else if(stage==2){
                    ...
                }
            }
            function doOnEnter(rowId,cellInd){
                ...
            }
            function doOnCheck(rowId,cellInd,state){
                ...
            }
            function doBeforeRowDeleted(rowId){
                return confirm("Are you sure you want to delete row");
            }

            mygrid = new ('gridbox');
            ...
            mygrid.attachEvent("onRowSelect",doOnRowSelected);
            mygrid.attachEvent("onEditCell",doOnCellEdit);
            mygrid.attachEvent("onEnter",doOnEnter);
            mygrid.attachEvent("onCheckbox",doOnCheck);
            mygrid.attachEvent("onBeforeRowDeleted",doBeforeRowDeleted);

            mygrid.init();
            mygrid.loadXML("grid.xml");</script>