Categories | Question details Back To List | ||
dhx Grid delete not working Hello, I am using the newest build 81107 of dhtmlx grid and when I tried to delete a row from the grid, the following error occurs in IE 'this._filter_length' is null or not an object is this a problem in the current build?, because before I upgraded the grid, the delete row worked fine , if this is a problem, can't I find a solution for it? Thanks in advance Answer posted by Support on Jan 23, 2009 09:29 Are you using some custom extension to the grid? There is no any occurrences of "_filter_length" in source files of dhtmlxgrid, it seems the problem is caused by the code not related to component. Answer posted by XB on Jan 23, 2009 10:26 I have some custom code for the delete function, but the same code worked fine before I upgraded to the newest build here's the code: function onMenuClick (id, cell) { cell = grids[mytabbar.getActiveTab()].contextID; if (grids[mytabbar.getActiveTab()].getSelectedRowId(",") == null) { // grids[mytabbar.getActiveTab()].selectRowById(cell.split ('_') [0]); } var sidSelected = grids[mytabbar.getActiveTab()].getSelectedRowId(","); alert(sidSelected); if (sidSelected.split(",").length > 1 && id != 'delete_row') alerts ("You may not perform this feature on more than one row at a time!"); else if (id == 'delete_row') { deleteGridRows(sidSelected); } else { if (id == 'reset_cell') { var split = cell.split ('_'); resetCell (split [0], split [1]); } else if (id == 'reset_row') { resetRow (cell.split ('_') [0]); } else if (id == 'add_header') { addheader(); } else if (id == 'add_footer') { addfooter(); } } } // the code is attached to a context menu inside the grid, when the user right click in grid, context menu appears, delete function is the main one
here's the deleteGridRows function which uses ajax function deleteGridRows (sidSelected) { var sidSplit = sidSelected.split(","); var newLabel; var http = getHTTPObject(); var direction = "remove"; var instanceID = document.getElementById("instanceid").value; var usergrid = mytabbar.getActiveTab(); http.open("POST", "/Ajax.go?job=drag&instanceID="+instanceID+"&sid="+sidSelected + "&direction="+direction+"&usergrid="+usergrid, true); http.onreadystatechange = function () { if (http.readyState == 4) { var ret=http.responseText; if (ret.indexOf("Error") > 0) { return false; } else { for (i=0;i<sidSplit.length;i++) { if (sidSplit[i].indexOf ('header') == -1 && sidSplit[i].indexOf ('footer') == -1) { newLabel = grids[mytabbar.getActiveTab()].cells(sidSplit[i],0).getValue(); // alert(sidSplit[i]); grids[mytabbar.getActiveTab()].deleteRow (sidSplit[i]); // <--- when the code reaches this line, the error shows up mygrid2.addRow(sidSplit[i], newLabel,0); } else { grids[mytabbar.getActiveTab()].deleteRow (sidSplit[i]); } } mygrid2.sortRows(0, "strSort", "asc"); updateFooters (); return true; } } } http.send(); return true; }
I used the same code before upgrading the grid to the newest build, and it worked fine as it deletes without error, and also multiple delete at once also worked but after upgrade, when code reaches one line, the error 'this._filter_length' is null or not an object appears. even though single delete still works but the error breaks the multiple delete. is it something I am doing wrong here? and what can I do to fix it? Thanks in advance
Answer posted by Support on Jan 26, 2009 01:51 Is error messages contains 'this._filter_length' or 'this._fillers.length' ? In second case, if you are using smart rendering and split modes in the same time - please try to use updated js files ( sent by email ) instead of original ones |