Can't delete row

Hello

I have to grids. I can put rows from one to another by click and drad’n’drop. If i move from first Grid to second and later delete in second Grid everything works fine.
But if i load data in second Grid from XML i’m not able to delete the row. I really tried everything but the row is still there.

What i’m doing wrong?

Thank you for any help

I’m using the normal way:

Grid.deleteRow(rId);

Please be sure that all rows, which are loaded in second grid, has an unique id.
If they has non-unique, or empty IDs - it can cause a similar issue.

Hmm … ID is definetly not empty and defintely unique …

Can you post the code of grids initialization ?

Hello Stanislav … here’s code of the GRID:

Grid[2] = Layout[4].cells('b').attachGrid();			
Grid[2].setImagePath('../dhtmlx/Grid/codebase/imgs/');
Grid[2].setIconsPath('../dhtmlx/Layout/imgs/');
Grid[2].setHeader("LP,Minuten,<span style='padding-left:8px'>Preis</span>,&nbsp;Menge,Bezeichnung,,Verstärker");
Grid[2].setInitWidths("30,59,58,60,198,25,25");
Grid[2].setColAlign("center,center,right,center,left,center,center");
Grid[2].setColTypes("ro,ro,edn,edn,ro,del_row,ro");
Grid[2].enableValidation(false, false, false, true, false, false, false);
Grid[2].setColValidators(",,,ValidNumeric,,,");
Grid[2].setColSorting("int,int,int,int,str,int,int");
Grid[2].setColumnColor("#FFBE7D,,,,,,");
Grid[2].setDateFormat('%d.%m.%Y');
Grid[2].setNumberFormat("€ 0,000.00",2,",",".");
Grid[2].enableEditEvents(true, false, false);
Grid[2].attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){ if (cInd == 2) { return false; } else { return true; } });
Grid[2].attachEvent("onCellChanged", function(rId,cInd,nValue){ if (cInd == 3) { Gesamt_LP_errechnen(2,1); } });
Grid[2].attachEvent("onDrop", function(sId,tId,dId,sObj,tObj,sCol,tCol){ 
	   Gesamt_LP_errechnen(2,1);
	   Gesamt_LP_errechnen(2,2); 
	   Mehraufwand_pruefen(2,0);
	   Abrechnung_pruefen(<?php echo $row_auftraege['wo_abt']; ?>,<?php echo $row_auftraege['folgeticket_id']; ?>,<?php echo $row_auftraege['wartung']; ?>,'<?php echo $row_auftraege['excel_date']; ?>','<?php echo $row_tk['id']; ?>','','','<?php echo $wo_typ; ?>',<?php echo $typ['um']; ?>); 
});
Grid[2].attachEvent("onCheckbox", function(rId,cInd,state) {
	   switch (state) {
		   case false: 					 
				 Grid[2].deleteRow(rId);					 					 
				 Gesamt_LP_errechnen(2,1);
				 Gesamt_LP_errechnen(2,2);
				 Abrechnung_pruefen(<?php echo $row_auftraege['wo_abt']; ?>,<?php echo $row_auftraege['folgeticket_id']; ?>,<?php echo $row_auftraege['wartung']; ?>,'<?php echo $row_auftraege['excel_date']; ?>','<?php echo $row_tk['id']; ?>','','','<?php echo $wo_typ; ?>',<?php echo $typ['um']; ?>);
				 break;
	   }
});
Grid[2].attachEvent("onValidationError", function(id, ind, value) { 
	   if (Form[5].getItemValue('field7_1').search(/Leistungspositionen - Die Mengenangabe ist unzu.+/) == -1) {
		      if (Form[5].getItemValue('field7_1') == "") { var neu = ""; } else { var neu = "\n"; }
		      Form[5].setItemValue('field7_1', Form[5].getItemValue('field7_1') + neu + unescape("(!)   Leistungspositionen - Die Mengenangabe ist unzul%E4ssig")); 			      
	   }
	   return true;
});
Grid[2].attachEvent("onValidationCorrect", function(id, ind, value) { 
	   if (Form[5].getItemValue('field7_1') == "") { var neu = ""; } else { var neu = "\n"; }
	   Form[5].setItemValue('field7_1', Form[5].getItemValue('field7_1') + neu + "OK-LP");
	   Abrechnung_pruefen(<?php echo $row_auftraege['wo_abt']; ?>,<?php echo $row_auftraege['folgeticket_id']; ?>,<?php echo $row_auftraege['wartung']; ?>,'<?php echo $row_auftraege['excel_date']; ?>','<?php echo $row_tk['id']; ?>','','','<?php echo $wo_typ; ?>',<?php echo $typ['um']; ?>);
});
Grid[2].enableDragAndDrop(true);
Grid[2].enableMercyDrag(true);			
Grid[2].init();			
Grid[2].setColumnHidden(6,true);
Grid[2].setSkin("dhx_skyblue");
Grid[2].loadXML("../dhtmlx/Data/XML/grid.php?id=43&wonr=<?php echo $wonr; ?>");
			
DataProcessor[1] = new dataProcessor("../dhtmlx/Data/XML/grid.php?id=15&merker=1&wonr=<?php echo $wonr; ?>");			
DataProcessor[1].setTransactionMode("POST", true);
DataProcessor[1].setUpdateMode("off");
DataProcessor[1].styles = {
    updated: "font-weight:normal; color:#000; text-decoration:none;",
    inserted: "font-weight:normal; color:#000; text-decoration:none;",
    invalid: "font-weight:normal; color:#900; text-decoration:none;",
    error: "font-weight:normal; color:#900; text-decoration:none;",
    clear: "font-weight:normal; color:#000; text-decoration:none;"};	
DataProcessor[1].init(Grid[2]);

Here is PHP Code for loading Data:

if($_GET['id'] == "43") {
   header("Content-type: text/xml");
   echo('<?xml version="1.0" encoding="ISO-8859-1"?>'); 
   echo '<rows>';
   
   $zaehler = 0;
   $result = mysql_query("SELECT ablp_lp,ablp_zeit,ablp_preis,ablp_menge,lp_bez FROM sk_abr_lp AS A INNER JOIN sk_lp AS B ON A.ablp_lp = B.lp_id WHERE A.ablp_wonr = '".$_GET['wonr']."'");      
   while($felder = mysql_fetch_assoc($result)) {
	  $zaehler++;
	  	  	  
	  echo ("<row id='".$zaehler."'>");
	  print("<cell><![CDATA[".$felder['ablp_lp']."]]></cell>");
	  print("<cell><![CDATA[".$felder['ablp_zeit']."]]></cell>");
	  print("<cell><![CDATA[".$felder['ablp_preis']."]]></cell>");
	  print("<cell><![CDATA[".$felder['ablp_menge']."]]></cell>");
	  print("<cell><![CDATA[&nbsp;&nbsp;".$felder['lp_bez']."]]></cell>");
	  print("<cell><![CDATA[1]]></cell>");
	  print("<cell><![CDATA[1]]></cell>");
	  echo("</row>");
   }
   echo '</rows>';
}

Tank you

Unfortunately the issue cannot be reproduced locally.
Please, provide with a demo link, where the issue can be reconstructed.

I prepared a demo Link. You can see the problem in the 2 black colorized Grids in the middle. If you press the red “X” happens nothing (you will see alert with Row-ID).
If you drag one row from the left grid (or clicking the first colorized column) to the right you can delete the row without any problem.

mds.umdispotool.de/php/demo … 6811&c=IFA

Thank you for your help

response from your page:
SyntaxError: syntax error
Gueltigkeit_pruefen(“1”,2); doOnLoad(); // extra coma (?)

In Demo Page is not filled because is a Cookie

Should work now

In case of disabled update mode of the dataProcessor you need to call sendData() method after the deleting of the row:

Grid[2].attachEvent("onCheckbox", function(rId,cInd,state) { //... Grid[2].deleteRow(rId); DataProcessor[1].sendData(); //... });

Hmm … happens nothing … the row is still in the grid.
I also don’t want to Send Data every time when i delete a row. I send Data at the end on pressing a Save-Button in the ToolBar.
Any other solution?

Hello

Any ideas?
I’m since 5 days with this problem and i don’t have more ideas.
We have a really big problem with this as we’re not able to edit loaded data :frowning:

Thank you

In case of disabled autoUpdate mode the row will be deleted from the grid only after the updated data will be sent to the server:
dhtmlx.com/docs/products/dht … _once.html

Thank you very much … got it :smiley: