dhtmlxgrid integration with dhtmlxcombo and dhtmlxconnector

I need your help.

I need to put a column of type “combo” in a dhtmlxGrid but it must be filled with the dhtmlxconnector and have dhtmlxcombo functionalities.

Appreciate if you can get an example of how to code this behavior as the interaction is only in the server and not in xml file

my email is .

aurbanog@gmail.com

/******************* my code ********/

var mygrid2 = tabbar.cells(“a3”).attachGrid();

		mygrid2.setImagePath("dhtmlxConnector_php/samples/common/imgs/");
		mygrid2.setHeader("IDJORNADA,IDPARALELO,CODIGOMATERIA, JORNADA , PARALELO , MATERIA , PROFESOR ");
		mygrid2.attachHeader("#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter")
		mygrid2.setInitWidths("20,20,20,80,80,200,300")
		mygrid2.setDateFormat("%Y-%m-%d");
		mygrid2.setColTypes("ro,ro,ro,ro,ro,ro,combo");
		mygrid2.setColSorting("connector,connector,connector,connector,connector,connector,connector")
		mygrid2.setColSorting("str,str,str,str,str,str,str")
		mygrid2.enableSmartRendering(true);
		mygrid2.enableMultiselect(true);
		mygrid2.setSkin("dhx_skyblue");
		//mygrid2.enableLightMouseNavigation(true);

		mygrid2.init();
		mygrid2.setColumnIds("IDJORNADA,IDPARALELO,CODIGOMATERIA,JORNADA,PARALELO,MATERIA,IDPROFESOR"); 

		mygrid2.loadXML("php/getMateriasAsignadas.php");

		var dp2 = new dataProcessor("php/getMateriasAsignadas.php");
		dp2.init(mygrid2);			
		dp2.setUpdateMode("off");

/****************************/

/* my server code */

$sql_doc =“SELECT IDPROFESOR as value,
concat( RTRIM(LTRIM(APELLIDO1)),’ ‘,RTRIM(LTRIM(APELLIDO2)),’ ‘,RTRIM(LTRIM(NOMBRE1)),’ ',RTRIM(LTRIM(NOMBRE2))) as label FROM sca_profesor”;

$docentesOpciones = new OptionsConnector($conn);
$docentesOpciones->render_sql($sql_doc,“IDPROFESOR”,“IDPROFESOR(value),label(label)”);

$sql = “SELECT CONCAT(sca_materia_profesor.IDJORNADA,sca_materia_profesor.IDPARALELO,
sca_materia_profesor.CODIGOMATERIA,sca_materia_profesor.IDPROFESOR) CLAVE,
sca_materia_profesor.IDJORNADA ,
sca_materia_profesor.IDPARALELO ,
sca_materia_profesor.CODIGOMATERIA ,
sca_jornada.DESJORNADA ,
sca_paralelo.DESPARALELO ,
sca_materias.DESMATERIA ,
sca_materia_profesor.IDPROFESOR
FROM
sca_periodo , sca_materia_profesor ,sca_materias , sca_jornada , sca_paralelo
where sca_periodo.ACTIVO = 1 and sca_materias.ACTIVA = 1 and sca_materia_profesor.ACTIVO = 1 and
sca_periodo.IDESCUELA = sca_materia_profesor.IDESCUELA and
sca_periodo.INICIOPERIODO = sca_materia_profesor.INICIOPERIODO and
sca_periodo.FINALPERIODO = sca_materia_profesor.FINALPERIODO and
sca_paralelo.IDPARALELO = sca_materia_profesor.IDPARALELO and
sca_jornada.IDJORNADA = sca_materia_profesor.IDJORNADA and
sca_materias.CODIGOMATERIA = sca_materia_profesor.CODIGOMATERIA and
sca_materia_profesor.IDESCUELA = “.$_SESSION[“escuela”].” and
sca_materia_profesor.INICIOPERIODO= '”.$_SESSION[“inicioperiodo”]."’ and
sca_materia_profesor.FINALPERIODO = ‘".$_SESSION[“finalperiodo”]."’
order by sca_jornada.DESJORNADA,sca_paralelo.DESPARALELO,sca_materias.DESMATERIA
";

$grid_mat_asig = new GridConnector($conn);
$grid_mat_asig->enable_log(“temp.log”,true);
$grid_mat_asig->dynamic_loading(1000);

$grid_mat_asig->sql->attach(“Update”,“UPDATE sca_materia_profesor
SET
IDPROFESOR=’{IDPROFESOR}’
WHERE
IDESCUELA = “.$_SESSION[“escuela”].” and
INICIOPERIODO= '”.$_SESSION[“inicioperiodo”]."’ and
FINALPERIODO = ‘".$_SESSION[“finalperiodo”]."’ and
IDJORNADA = {IDJORNADA} and
IDPARALELO= {IDPARALELO} and
CODIGOMATERIA = ‘{CODIGOMATERIA}’ " );

$grid_mat_asig->set_options(“IDPROFESOR”,$docentesOpciones);

$grid_mat_asig->render_sql( $sql ,“CLAVE”,“IDJORNADA,IDPARALELO,CODIGOMATERIA, DESJORNADA,DESPARALELO, DESMATERIA , IDPROFESOR”);

/* ****************************/

if i put

mygrid2.setColTypes(“ro,ro,ro,ro,ro,ro,coro”);

work is correct but no present combo

if i put

mygrid2.setColTypes(“ro,ro,ro,ro,ro,ro,combo”);

the error is:

/******************/

Message: Object doesn’t support this property or method
Line: 1579
Char: 733
Code: 0
URI: localhost/federacion/dhtmlxConne … /dhtmlx.js

/****************/

i understand dhtmlxConnector not supported “combo” type inside the dhtmlxgrid

Please
your comments is greatly appreciated

Please try to use the updated js file, instead of the original one.
connector_upd2.zip (1.39 KB)

hi Stanislav

I need your help

I need put one tabbar with two tabs, in first tab put the combobox and edit text components, in change tab i need send this values to server and store in session variables for construct the SQL.

The sql polulate the second dhtmlxdatagrid in second tab.

What is the mejor form to implement this feature.

I need additional help, please send the link to download the code for demo samples (File Explorer Demo… etc).

I need check the best practices in this demos for implemented in my development software.

What is the mejor form to implement this feature.
There are many ways to implement such behavior, the most logical , as I can see it, will be handle onSelect event of tabbar, and from it reload the grid with new data by grid.load, in the url , used for data loading you can place values from the inputs from the first tab.

I need additional help, please send the link to download the code for demo samples (File Explorer Demo… etc).

Unfortunately there is no such online package, if you need one - drop email to the support@dhtmlx.com

hi Stanislav

I need your help, in this moment i have one big error.

I development one interfase in windows system operative, in this machine the session variables of PHP is propagated to all pages.

Example in my code

mygrid2.loadXML(“php/getMateriasAsignadas.php”);

the sql in getMateriasAsignadas.php is:

$sql = “SELECT CONCAT(sca_materia_profesor.IDJORNADA,sca_materia_profesor.IDPARALELO,
sca_materia_profesor.CODIGOMATERIA,sca_materia_profesor.IDPROFESOR) CLAVE,
sca_materia_profesor.IDJORNADA ,
sca_materia_profesor.IDPARALELO ,
sca_materia_profesor.CODIGOMATERIA ,
sca_jornada.DESJORNADA ,
sca_paralelo.DESPARALELO ,
sca_materias.DESMATERIA ,
sca_materia_profesor.IDPROFESOR
FROM
sca_periodo , sca_materia_profesor ,sca_materias , sca_jornada , sca_paralelo
where sca_periodo.ACTIVO = 1 and sca_materias.ACTIVA = 1 and sca_materia_profesor.ACTIVO = 1 and
sca_periodo.IDESCUELA = sca_materia_profesor.IDESCUELA and
sca_periodo.INICIOPERIODO = sca_materia_profesor.INICIOPERIODO and
sca_periodo.FINALPERIODO = sca_materia_profesor.FINALPERIODO and
sca_paralelo.IDPARALELO = sca_materia_profesor.IDPARALELO and
sca_jornada.IDJORNADA = sca_materia_profesor.IDJORNADA and
sca_materias.CODIGOMATERIA = sca_materia_profesor.CODIGOMATERIA and
sca_materia_profesor.IDESCUELA = “.$_SESSION[“escuela”].” and
sca_materia_profesor.INICIOPERIODO= '”.$_SESSION[“inicioperiodo”]."’ and
sca_materia_profesor.FINALPERIODO = ‘".$_SESSION[“finalperiodo”]."’
order by sca_jornada.DESJORNADA,sca_paralelo.DESPARALELO,sca_materias.DESMATERIA
";

for example.

In windows all site working correct.

But in linux host not propagated the session php variables, the result is complete site not work.

Please your help with one example, for send the session variables in

mygrid2.loadXML(“php/getMateriasAsignadas.php”); method.

I undestand the session lose in this method.

Beyond i put the flag.

session.auto_start = 1

in server.

But not propagate the session variables.

Please
your comments is greatly appreciated

Can you create few dummy pages , one of which saves something to session and other one reads from it?

Grid data loading request must be processed by the same rules as normal browser page loading. So if session works for test pages - it must work for the grid as well.

One more possible issue - check that you have not element with empty src attribute on the page. Empty src can generate call to the index page of current folder , which can contain some session clearing code.