Categories | Question details Back To List | ||||||||||||||
dhtmlxGrid last row's setVerificator function not working I am using dhtmlxGrid v.2.0 Professional edition build 81009/81107 when I add a new row, following 3 lines not working at grid's last row, myDataProcessor2.setVerificator(0); myDataProcessor2.setVerificator(1); myDataProcessor2.setVerificator(1,validateEmail); <head> <title>addressbook</title> <link rel="stylesheet" type="text/css" href="../dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.css" /> <script src="../dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxcommon.js"></script> <script type="text/javascript" src="../dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.js"></script> <script type="text/javascript" src="../dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script> <script src="../dhtmlxSuite/dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js"></script> <script src="../dhtmlxSuite/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js"></script> <script src="../dhtmlxSuite/dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js"></script> <style> .grid_hover { background-color:#7FFFD4; font-size:20px; } </style> <script> function addRow(){ var newId = (new Date()).valueOf(); mygrid.addRow(newId, ",,"); } function removeRow(){ var selId = mygrid.getSelectedId() if (selId == "") { alert("please select delete row !!"); return; } mygrid.deleteRow(selId); } function validateEmail(value,colName) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/ //var reg = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ var address = value.toString()._dhx_trim(); if(reg.test(address) == false) { alert('Email format error!!'); return false; } else return true; } </script> </head> <body style="margin: 0px; "> <center> <table width='80%' height='100%'> <tr> <td width='70%'> <div id="mygrid_container" style="width:100%;height:100%;overflow:auto;"></div></td> <td width='30%' valign="top"> <button onclick="addRow();mygrid.selectCell(mygrid.getRowsNum() - 1,0, false, true, true);">add row</button><br /> <button onclick="removeRow()">delete row</button><br /> <button style="background-color:pink" onclick="myDataProcessor2.sendData();">save data</button> </td> </tr> </table> </center> <script> var mygrid = new dhtmlXGridObject('mygrid_container'); mygrid.setImagePath("../dhtmlxSuite/dhtmlxGrid/codebase/imgs/"); mygrid.setHeader("Name,Email,Title"); mygrid.attachHeader("#text_search,#text_search,#text_search"); mygrid.setColumnIds("name,email,pos") mygrid.setInitWidths("150,*,150"); mygrid.setColAlign("left,left,left") mygrid.setSkin("modern"); mygrid.setColSorting("str,str,str"); mygrid.enableEditTabOnly(1); mygrid.preventIECaching(true); mygrid.enableRowsHover(true,'grid_hover') mygrid.setActive(true); mygrid.init(); mygrid.loadXML("addressbook_contactor_get.aspx"); myDataProcessor2 = new dataProcessor("addressbook_contactor_update.aspx"); myDataProcessor2.setTransactionMode("POST"); myDataProcessor2.setUpdateMode("off"); myDataProcessor2.enableDebug(true); myDataProcessor2.setVerificator(0); myDataProcessor2.setVerificator(1); myDataProcessor2.setVerificator(1,validateEmail); myDataProcessor2.init(mygrid); </script> </body> </html> Answer posted by dhxSupport on Aug 27, 2009 02:34 Please try to replace your dhtmlxdataprocessor.js file with file from attachment. If issue still occurs please provide us complete example where we can reproduce it. Attachments (1)
Answer posted by Frank on Aug 27, 2009 05:47 I set setUpdateMode("off"). User need press "savedata" button to senddata to server site This version "dataprocessor" have following problems 1. after press "add row", all these setVerificator function not working ( if I add two rows or more, same situation) 2. after save the data, all these setVerificator function are working 3. column sorting function not working Answer posted by dhxSupport on Aug 31, 2009 03:10 Unfortunately we cannot reproduce this issue locally. Please provide us complete example where we can reproduce it. Answer posted by Frank on Sep 01, 2009 05:05 My program as follow: aspx file with c# <%@ Page Language="C#" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> </script> <html> } <body style="margin: 0px; "> myDataProcessor2.setVerificator(1); </script> addressbook_contactor_get.aspx will generate following xml string <?xml version="1.0" encoding="utf-8"?>
Attachments (1)
|