draganddrop dhtmlgridfromtable

hi, please i need your help



I have a problem when importing data from a table (HTML)! using dhtmlXGridFromTable i need drag and drop between tables! in the examples and documentation provided by you, only need to include the script dhtmlxgrid_drag.js

and use mygrid.enableDragAndDrop (true) “the examples are using XML” need help, i dont know if that propiety is only for data from XML and dont function in html table …



thanks

Ap

It can be used in case of loading from HTML table as well.
The tricky point that enableDragAndDrop need to be called before data parsed from table in grid, it can be done as

<table class=“dhtmlxGrid” name=“mygrid” onbeforeinit=“mygrid.enableDragAndDrop(true);” …


Thank you my friend!! you help me so much…



I decided do it because is more easy work when load data from xml…  i dont know XML and decided generate a PHP file and there create the XML file



<?php
function iniciar_xmlgrid($tabla,$archivo)
{
include"abrir_conexion_DB.php";
$query=“SELECT * FROM $tabla”;
$result=mssql_query($query,$link);



$xml=’<?xml version="1.0" encoding="UTF-8"?>’;
$xml.=’’;
while($fila = mssql_fetch_array($result))
 {
 $id_concepto=$fila[id_concepto];
 $n_concepto=  $fila[concepto];
 $concepto_mostrar=$fila[concepto_mostrar];
 $t_concepto=$fila[tipo_concepto];
$xml.=’<row id="’; $xml.="$id_concepto"; $xml.=’">’;
$xml.=’’; $xml.="$concepto_mostrar"; $xml.=’’;$xml.=’’;
 }
$xml.=’’; 
file_put_contents("$archivo.xml",$xml);
mssql_close($link);
}
?>



PD: My English is not so good because I am of venezuela (latino) 



thanks for all your answers…  

The code which you are using is correct but the next things can be done

a) cell value may contain special chars , which can break XML syntax, to be safe you can change it as

$xml.=’<![CDATA['; $xml.="$concepto_mostrar"; $xml.=']]>’;

b) you are using temp xml file for result saving, which may be correct in your case, but in most case data can be loaded directly from php stream.

$xml.=’’;
//file_put_contents("$archivo.xml",$xml);
header(“Content-type:text/xml”);
echo $xml;

mssql_close($link);

and in js code use

grid.load(“some.php”); //some.php contain call of iniciar_xmlgrid