Issues with Form initialization:TypeError: this.cont is null

I have been playing with the dhtmlx libraries, because started the project with the dhtmlx.js BUT there was an issue with the calendar not displaying in the form and grid and a new dhtmlxcalendar.js was provided in other post so proceeded to update my project with it, also I have dhtmlx suite 3.0 professional purchased, but decided to use just the grid from that version and take advantages of the new 3.6, well with the 3.6 dhtmlx.js and dhtmlx.css everything works fine in the above code, except for the calendar not displaying but when added the libraries and tried to use them, I get many time the error:

TypeError: this.cont is null

debugging located the error in the function:

cargaUsuarios()

commented everything and with just the form initialization still getting this error in that function, is commented to identify the issue independently of others objects, added all libraries for the form but still having the issue, also have problems with the combo in the form and thinking maybe is related.

Already tried to compile a new dhtmlx.js with the updated dhtmlxcalendar.js, but just nothing works in my new compiled library, so decided to come here to see if anyone had the same issue before.

I also added the images:
combo_select_dhx_skyblue.gif
combo_select_dhx_combo_select.gif

because the files was missing and can’t figure out how to add them in the css of the combo, so was fast to just put the missing image in the supposed location.

Also there is a problem with the Function:
rpExA()

that is called in the main menu from the option:

Emergencias Atendidas

Is not displaying the calendars and after the first selection, the second gives a NaN-NaN-NaN.

I also uploading a complete demo that reproduces the problem in my localhost enviroment.
The Complete Demo is in:

mediafire.com/?r3j455p0npg6z2v

<?php

/**
 * @author edsphinx
 * @copyright 2013
 */
session_start();
if(!isset($_SESSION['auth'])){
	header("Location: index.php");
	exit;
}else{

require_once("classes/model/usuario.php");

$uid = $_GET['id'];

$luser = new usuario();

//$luser->get_Usuario   ($uid);

?>

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lt8"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7 lt8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8 lt8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="UTF-8" />
        <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  -->
        <title>Login para Seguridad G4S</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="Login and Registration Form with HTML5 and CSS3" />
        <meta name="keywords" content="html5, css3, form, switch, animation, :target, pseudo-class" />
        <meta name="author" content="Codrops" />
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="stylesheet" type="text/css" href="css/animate-custom.css" />
        <script src="login.js" type="text/javascript"></script>
        <script src="js/md5.js" type="text/javascript"></script>
    </head>
    <body onload="doOnLoad();"> 
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <link rel="stylesheet" type="text/css" href="classes/dhtmlx_std_full/skins/dhtmlxmenu_dhx_blue.css">
    <link rel="stylesheet" type="text/css" href="classes/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css">
    <link rel="stylesheet" type="text/css" href="classes/dhtmlxCombo/codebase/dhtmlxcombo.css">
    <link href="classes/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn_bricks.css" rel="stylesheet" type="text/css" />
    	
        
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/dhtmlxcommon.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/dhtmlxcontainer.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/dhtmlxlayout.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4a.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4c.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4e.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4f.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4g.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4j.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4l.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4w.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern5e.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern5u.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern5w.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern6c.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern6e.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern6w.js"></script>
        <script type="text/javascript" src="classes/dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern7h.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxMenu/codebase/dhtmlxmenu.js"></script>
        <script type="text/javascript" src="classes/dhtmlxMenu/codebase/ext/dhtmlxmenu_ext.js"></script>
        <script type="text/javascript" src="classes/dhtmlxMenu/codebase/ext/dhtmlxmenu_effects.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
        <script type="text/javascript" src="classes/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
        <script type="text/javascript" src="classes/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn.js"></script>
        <script type="text/javascript" src="classes/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_dhxcalendar.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxWindows/codebase/dhtmlxwindows.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/dhtmlxform.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_backup.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_dyn.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_hide_on_disable.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_btn2state.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_colorpicker.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_calendar.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_combo.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_container.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_editor.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/dhtmlxform_item_upload.js"></script>
        <script type="text/javascript" src="classes/dhtmlxForm/codebase/ext/swfobject.js"></script>
               
        <script type="text/javascript" src="classes/dhtmlxCalendar/codebase/dhtmlxcalendar.js"></script>
        <script type="text/javascript" src="classes/dhtmlxCalendar/codebase/ext/dhtmlxcalendar_double.js"></script>
        
        <script type="text/javascript" src="classes/dhtmlxCombo/codebase/dhtmlxcombo.js"></script>
        <script type="text/javascript" src="classes/dhtmlxCombo/codebase/ext/dhtmlxcombo_extra.js"></script>
        <script type="text/javascript" src="classes/dhtmlxCombo/codebase/ext/dhtmlxcombo_group.js"></script>
        <script type="text/javascript" src="classes/dhtmlxCombo/codebase/ext/dhtmlxcombo_whp.js"></script>
        
        <script type="text/javascript" src="classes/codebase/datastore.js"></script>
        <script type="text/javascript" src="classes/codebase/connector.js"></script>
        <script type="text/javascript" src="classes/codebase/dhtmlxdataprocessor.js"></script>
        
        <div class="container">
            <!-- Codrops top bar -->
            <!--/ Codrops top bar -->
            <header>
                <h1>Bienvenido al Backend de Seguridad G4S<span></span></h1>
				<nav class="codrops-demos">
					
				</nav>
            </header>
            <section>				
                <div>
                    <!-- hidden anchor to stop jump http://www.css3create.com/Astuce-Empecher-le-scroll-avec-l-utilisation-de-target#wrap4  -->
                    <div>
                        <div>
                          <table width="1200" border="1" align="center">
                              <tr>
                                <td>&nbsp;</td>
                              </tr>
                              <tr>
                                <td><div id="parentId" style="position: relative; top: 0px; left: 0px; width: 1260px; height: 480px; aborder: #B5CDE4 1px solid;"></div></td>
                              </tr>
                                <tr>
                                <td><div id="recinfoArea" style="aborder: #B5CDE4 1px solid;"></div></td>
                              </tr>
                              <tr>
                                <td><div id="recinfoAreaStatus" style="aborder: #B5CDE4 1px solid;"></div></td>
                              </tr>
                            
                            </table>
                        </div>
                  </div>				
                </div>  
            </section>
        </div>
        <script>
        var GMaps;
        var Usegrid,Cliegrid;
        var vari,dashactive=false;
        var formAdd;
        var markersArray = [];

        var _clients = new dhtmlXDataStore({  
		          url:"connectors/clients_data.php"
              });
        
        _clients.attachEvent("onXLE",function(){
            _clients.setCursor(0);
        });
        
        _clients.data.scheme({
            		usr:"Nuevo Usuario",
                    pass:"",
                    nombre:"Nuevo Nombre",
                    direccion: "Desconocida",
                    telefono: "",
                    celular: "",
                    bbm: "",
            		email:"Unknown",
                    estado: 0,
                    lat: 0,
                    lgn: 0,
                    emergencia: 0
    	});
        
        var viewClientFrm = [    
            { type: "settings", position: "label-left", labelWidth: 140, inputWidth: 350 },
            { type:"fieldset", readonly: true , name:"_usuario", label:"Cliente", inputWidth: "auto", 
            list:[
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: true , name:"paisID", label:"Pais", validate:"NotEmpty",
                            connector: "connectors/obtenerpaises.php" },
                    { type:"combo", readonly: true , name:"ciudadID", label:"Ciudad", validate:"NotEmpty" ,
                            connector: "connectors/obtenerciudades.php?id=<?php echo $_SESSION['paisID']; ?>" },
            		{ type:"input", readonly: true , name:"nombre", label:"Nombre Completo", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"identidad", label:"No. Identidad", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: true , name:"telefono", label:"Telefono", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"celular", label:"Celular", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"direccion", label:"Direccion", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"email", label:"Correo Electronico", validate:"NotEmpty" },                    
                ]},
                {type: "block", width: 1120, list:[
                    { type:"input", readonly: true , name:"trabajo", label:"Trabajo", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: true , name:"teltrabajo", label:"Telefono Trabajo", validate:"NotEmpty" },
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"input", readonly: true , name:"contacto1", label:"Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"telcontacto1", label:"Telefono Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"celcontacto1", label:"Celular Contacto 1", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: true , name:"contacto2", label:"Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"telcontacto2", label:"Telefono Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: true , name:"celcontacto2", label:"Celular Contacto 2", validate:"NotEmpty" },                    
            	]},
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: true , name:"distribuidorID", label:"Distribuidor", validate:"NotEmpty" ,
                            connector: "connectors/obtenerdistribuidor.php?id=<?php echo $_SESSION['paisID']; ?>" },
                    { type:"input", readonly: true , name:"usr", label:"Usuario", validate:"NotEmpty" },
            		{ type:"checkbox", readonly: true , name:"estado", label:"Activo" },
            		{ type: "newcolumn", offset:40},
                    { type: "fieldset", label: "Foto", width:550,
                    list: [
                        {type: "label", name: "imagen", label: "" },
                    ]},                    
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"hidden", readonly: true , name:"lat", label:"Latitud", validate:"NotEmpty" },
            		{ type:"hidden", readonly: true , name:"lgn", label:"Longitud", validate:"NotEmpty" },
                    { type:"hidden", readonly: true , name:"photo", label:"Fotografia", validate:"NotEmpty" },                              		
                ]},                
                { type: "button", name:"saveButton", value: "Cerrar" }
    		]}            
    	];
        
       
        var editClientFrm = [    
            { type: "settings", position: "label-left", labelWidth: 140, inputWidth: 350 },
            { type:"fieldset", readonly: true , name:"_usuario", label:"Cliente", inputWidth: "auto", 
            list:[
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: false , name:"paisID", label:"Pais", validate:"NotEmpty",
                            connector: "connectors/obtenerpaises.php" },
                    { type:"combo", readonly: false , name:"ciudadID", label:"Ciudad", validate:"NotEmpty" ,
                            connector: "connectors/obtenerciudades.php?id=<?php echo $_SESSION['paisID']; ?>" },
            		{ type:"input", readonly: false , name:"nombre", label:"Nombre Completo", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"identidad", label:"No. Identidad", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"telefono", label:"Telefono", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celular", label:"Celular", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"direccion", label:"Direccion", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"email", label:"Correo Electronico", validate:"NotEmpty" },                    
                ]},
                {type: "block", width: 1120, list:[
                    { type:"input", readonly: false , name:"trabajo", label:"Trabajo", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"teltrabajo", label:"Telefono Trabajo", validate:"NotEmpty" },
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"input", readonly: false , name:"contacto1", label:"Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"telcontacto1", label:"Telefono Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celcontacto1", label:"Celular Contacto 1", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"contacto2", label:"Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"telcontacto2", label:"Telefono Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celcontacto2", label:"Celular Contacto 2", validate:"NotEmpty" },                    
            	]},
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: false , name:"distribuidorID", label:"Distribuidor", validate:"NotEmpty" ,
                            connector: "connectors/obtenerdistribuidor.php?id=<?php echo $_SESSION['paisID']; ?>" },
                    { type:"input", readonly: false , name:"usr", label:"Usuario", validate:"NotEmpty" },
            		{ type:"password", readonly: false , name:"pass", label:"Contrase&ntilde;a", validate:"NotEmpty" },
                    { type:"checkbox", readonly: false , name:"estado", label:"Activo" },
            		{ type: "newcolumn", offset:40},
                    { type: "fieldset", label: "Subir Foto", width:550,
                    list: [
                        {type: "label", name: "imagen", label: "" },
                        {type: "newcolumn", offset:10},
                        { type:"upload", readonly: false , name:"fileUpload", titleScreen: false, width:300,
                                    url: "classes/codebase/dhtmlxform_item_upload.php", autoStart: true, 
                                _swfLogs: "enabled", swfPath: "classes/codebase/ext/uploader.swf", swfUrl: "classes/codebase/dhtmlxform_item_upload.php",
                                label:"Foto", validate:"NotEmpty" },
                    ]},                    
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"hidden", readonly: false , name:"lat", label:"Latitud", validate:"NotEmpty" },
            		{ type:"hidden", readonly: false , name:"lgn", label:"Longitud", validate:"NotEmpty" },
                    { type:"hidden", readonly: false , name:"photo", label:"Fotografia", validate:"NotEmpty" },                              		
                ]},                
                { type: "button", name:"saveButton", value: "Guardar" }
    		]}            
    	];        
       
        var addClientFrm = [    
            { type: "settings", position: "label-left", labelWidth: 140, inputWidth: 350 },
            { type:"fieldset", readonly: true , name:"_usuario", label:"Nuevo Cliente", inputWidth: "auto", 
            list:[
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: false , name:"paisID", label:"Pais", validate:"NotEmpty",
                            connector: "connectors/obtenerpaises.php" },
                    { type:"combo", readonly: false , name:"ciudadID", label:"Ciudad", validate:"NotEmpty" },
            		{ type:"input", readonly: false , name:"nombre", label:"Nombre Completo", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"identidad", label:"No. Identidad", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"telefono", label:"Telefono", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celular", label:"Celular", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"direccion", label:"Direccion", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"email", label:"Correo Electronico", validate:"NotEmpty" },                    
                ]},
                {type: "block", width: 1120, list:[
                    { type:"input", readonly: false , name:"trabajo", label:"Trabajo", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"teltrabajo", label:"Telefono Trabajo", validate:"NotEmpty" },
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"input", readonly: false , name:"contacto1", label:"Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"telcontacto1", label:"Telefono Contacto 1", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celcontacto1", label:"Celular Contacto 1", validate:"NotEmpty" },
                    {type: "newcolumn", offset:100},
                    { type:"input", readonly: false , name:"contacto2", label:"Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"telcontacto2", label:"Telefono Contacto 2", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"celcontacto2", label:"Celular Contacto 2", validate:"NotEmpty" },                    
            	]},
                {type: "block", width: 1120, list:[
                    { type:"combo", readonly: false , name:"distribuidorID", label:"Distribuidor", validate:"NotEmpty" },
                    { type:"input", readonly: false , name:"usr", label:"Usuario", validate:"NotEmpty" },
            		{ type:"password", readonly: false , name:"pass", label:"Contrase&ntilde;a", validate:"NotEmpty" },
                    { type:"checkbox", readonly: false , name:"estado", label:"Activo" },
            		{ type: "newcolumn", offset:40},
                    { type: "fieldset", label: "Subir Foto", width:550,
                    list: [
                        {type: "label", name: "imagen", label: "" },
                        {type: "newcolumn", offset:10},
                        { type:"upload", readonly: false , name:"fileUpload", titleScreen: false, width:300,
                                    url: "classes/codebase/dhtmlxform_item_upload.php", autoStart: true, 
                                _swfLogs: "enabled", swfPath: "classes/codebase/ext/uploader.swf", swfUrl: "classes/codebase/dhtmlxform_item_upload.php",
                                label:"Foto", validate:"NotEmpty" },
                    ]},                    
                ]},
                {type: "block", width: 1120, list:[
            		{ type:"hidden", readonly: false , name:"lat", label:"Latitud", validate:"NotEmpty" },
            		{ type:"hidden", readonly: false , name:"lgn", label:"Longitud", validate:"NotEmpty" },
                    { type:"hidden", readonly: false , name:"photo", label:"Fotografia", validate:"NotEmpty" },                              		
                ]},                
                { type: "button", name:"saveButton", value: "Guardar" }
    		]}            
    	];

        
        var formDataAdd = [
          {type: "block", list:[                        
              {type: "button", name: "insert", value: "Agregar <img src='images/add.png' width='10' height='10'/>", label: "Agregar" },
          ]}   
       ]; 
        
        
        var selDistribuidor = [    
            { type: "settings", position: "label-left", labelWidth: 80, inputWidth: 250 },
            { type:"fieldset", readonly: true , name:"_cliente", label:"Reporte de Clientes por Distribuidor", inputWidth: "auto", 
            list:[
                {type: "block", width: 300, list:[
                    { type:"combo", readonly: false , name:"distribuidorID", label:"Distribuidor", validate:"NotEmpty",
                            connector: "connectors/obtenerdistribuidor.php?id=<?php echo $_SESSION['paisID']; ?>" },
            	]},                
    		]},
            { type: "button", name:"saveButton", value: "Generar Reporte" }
    	];
        
        var selCliente = [    
            { type: "settings", position: "label-left", labelWidth: 80, inputWidth: 250 },
            { type:"fieldset", readonly: true , name:"_cliente", label:"Emergencias de Cliente", inputWidth: "auto", 
            list:[
                {type: "block", width: 300, list:[
                    { type:"combo", readonly: false , name:"clienteID", label:"Cliente", validate:"NotEmpty",
                            connector: "connectors/obtenerclientes.php" },
            	]},                
    		]},
            { type: "button", name:"saveButton", value: "Cargar Bitacora" }
    	];
                      
        var selRangoFechas = [    
            { type: "settings", position: "label-left", labelWidth: 80, inputWidth: 250 },
            { type:"fieldset", readonly: true , name:"_cliente", label:"Reporte de Emergencias Atendidas", inputWidth: "auto", 
            list:[
                {type: "block", width: 300, list:[
                    {type: "calendar", dateFormat: "%Y-%m-%d %H:%i", name: "start_date", label: "Fecha Inicio", readonly:true},
                    {type: "calendar", dateFormat: "%Y-%m-%d %H:%i", name: "end_date", label: "Fecha Final", readonly:true},
            	]},                
    		]},
            { type: "button", name:"saveButton", value: "Generar Reporte" }
    	];
        
        
        function cargaUsuarios(){
            //Aqui cargare usuarios
            
            //Usegrid = layout.cells("a").attachGrid();
            //var sb = layout.cells("a").attachStatusBar();
            //sb.setText("<div id='frmAddbtn'></div><div id='recinfoArea'></div>");
            
            formAdd = new dhtmlXForm("frmAddbtn", formDataAdd);
            /*
            Usegrid.setImagePath("classes/dhtmlx_std_full/imgs/");//path to images required by grid
        	Usegrid.setHeader("Id, Usuario, Permiso, Pais, Activo");//set column names
        	Usegrid.setInitWidths("50,150,300,150,50");//set column width in px
        	Usegrid.setColAlign("left,left,left,left,left");//set column values align
        	Usegrid.setColTypes("ro,ro,ro,ro,ch");//set column types
        	Usegrid.setColSorting("str,str,str,str,str");//set sorting
            Usegrid.enablePaging(true,18,3,"recinfoArea",false);
            Usegrid.setPagingSkin("toolbar", "dhx_skyblue");
        	Usegrid.init();//initialize grid
        	Usegrid.loadXML("connectors/get_usuarios.php");
            
            formAdd.attachEvent("onButtonClick", function(id){
                if (id=='insert'){
                        winaddAdmin();
                }
            })
        	
            Usegrid.i18n.paging={
                  results:"Results",
                  records:"Registros de ",
                  to:" a ",
                  page:"Pagina ",
                  perpage:"lineas por pagina",
                  first:"A primera Pagina",
                  previous:"Pagina anterior",
                  found:"Encontro registros",
                  next:"Siguiente Pagina",
                  last:"A ultima Pagina",
                  of:" de ",
                  notfound:"Ningun Registro Encontrado" };
                  */
        }           
        
        function rpExA(){
            var dhxWinsr2 = new dhtmlXWindows();
            dhxWinsr2.enableAutoViewport(false);
            dhxWinsr2.attachViewportTo("parentId");
            dhxWinsr2.setImagePath("classes/codebase/imgs/");
            var wBtr2 = dhxWinsr2.createWindow("wBtr2", 20, 20, 370,260);            
            wBtr2.setText("Seleccionar Rango Fechas");
            wBtr2.setModal(true);
            wBtr2.center();  
            var selRngFch = wBtr2.attachForm(selRangoFechas);
            
            selRngFch.attachEvent("onButtonClick", function(id){
                if (id=='saveButton'){
                        dI=selRngFch.getItemValue("start_date");
                        dF=selRngFch.getItemValue("end_date");
                        cargaEmergenciasAtendidas(dI,dF,wBtr2);
                }
            })            
        }
        
        function cargaEmergenciasAtendidas(_di,_df,_winOj){
            //Aqui cargare usuarios
            layoutDistribuidores = new dhtmlXLayoutObject(layout.cells("a"), "1C");
            layoutDistribuidores.cells("a").hideHeader();
            
            gridDistribuidor = layoutDistribuidores.cells("a").attachGrid();
            //var sb = layoutDistribuidores.cells("a").attachStatusBar();
            //sb.setText("<div id='recinfoArea'></div>");
            
            gridDistribuidor.setImagePath("classes/dhtmlx_std_full/imgs/");//path to images required by grid
        	gridDistribuidor.setHeader("Id, Pais, Distribuidor");//set column names
        	gridDistribuidor.setInitWidths("60,180,220");//set column width in px
        	gridDistribuidor.setColAlign("left,left,left");//set column values align
        	gridDistribuidor.setColTypes("ro,ro,ro");//set column types
        	gridDistribuidor.setColSorting("str,str,str");//set sorting
            
            gridDistribuidor.enablePaging(true,18,3,"recinfoArea",false);
            gridDistribuidor.setPagingSkin("toolbar", "dhx_skyblue");
            gridDistribuidor.init();//initialize grid
        	gridDistribuidor.loadXML("connectors/get_distribuidor.php",function(){
        	   _winOj.close();
        	});
        	
            gridDistribuidor.i18n.paging={
                  results:"Results",
                  records:"Registros de ",
                  to:" a ",
                  page:"Pagina ",
                  perpage:"lineas por pagina",
                  first:"A primera Pagina",
                  previous:"Pagina anterior",
                  found:"Encontro registros",
                  next:"Siguiente Pagina",
                  last:"A ultima Pagina",
                  of:" de ",
                  notfound:"Ningun Registro Encontrado" };
            
        }
        

        
    </body>
<!-- InstanceEnd --></html><?php }?>

Regards,
edsphinx

Hi

any little db-dump and steps to reproduce?
you can send it by email support@dhtmlx.com

the Dumb Data with the DB Structure used is sent already.

hi

this.cont is null … error in the function: cargaUsuarios()

if you demo document.getElementById(“frmAddbtn”) not found, that’s why form init failed
if uncomment lines above attachStatusBar and sb.setText, form inited in status bar

function cargaUsuarios(){
formAdd = new dhtmlXForm(“frmAddbtn”, formDataAdd);

… option: Emergencias Atendidas

dhtmlxForm/codebase/ext/dhtmlxform_hide_on_disable.js
this file should be included after all form’s items (in your demo before swfobj.js)
it add extra functionality to items (this.en2 is not defined error)

Is not displaying the calendars and after the first selection

localy in your demo it not displaying anything and throws no errors

…after more debug

not displaying anything

windows and calendar were not visible because css files were not attached in demo
adding the following links fixed the problems (in demo, main.php):

[code]

[/code]

regarding calendar:
attached is a latest version, just update your classes/dhtmlxCalendar folder
calendar_new.rar (49.5 KB)

Andrei, thank you very much, the updated calendar resolved the issue with the Form, but now the Grid don’t show any dates, you know what can be the reason for this.

hi

please provide some steps how to reproduce. I do not see grid with dates in your demo

Andrei the Complete Demo with the Calendar is in the function:

cargaBitacoraClientes();

You can call it in the main Menu in “Bitacora”

Also Have an issue in Mantenimientos->Clientes->Editar the pencil Button in the Grid, the Combo in the Form for the option Ciudad don’t load properly, just load the ID of the DB but don’t selected the proper item from the ComboBox option, the ComboBox “Distribuidor” in the same Form do exactly the same and works just fine and can’t find out why is this issue with the other Combo, they are in the function:
winMntClientes(selId)

The one with the issue is:
var dhxCmbcity = edFrmClnt.getCombo(“ciudadID”);

And the other that is almost exactly the same and is working properly:
var dhxCmbdist = edFrmClnt.getCombo(“distribuidorID”);

Another Issue is with the Grid in the Menu Option “Reportes”->“Emergencias Atendidas Por Rango de Fecha” then select a date range I receive the XML with 20 Rows but only display 1 Row of data in the Grid, even if I export to Excel will show the 20 Registers in Excel, but only keep displaying 1 in the Grid, any idea why is this?

The function that load such grid is: cargaEmergenciasAtendidas

Included in the completedemo.zip is the completedemo.sql with the DB struct and some data extracted.

Here is the new demo with the Grid Included
mediafire.com/download/umops … tedemo.rar




Hi

Another Issue is with the Grid in the Menu Option “Reportes”->“Emergencias Atendidas Por Rango de Fecha”

all your rows have the same row id, id should be different for each row

Combos

var dhxCmbcity = edFrmClnt.getCombo(“ciudadID”);

due form init this combo do not have neither value nor connector attr,
combo is empty on init stage

then you load values into form (from server, async request) -
edFrmClnt.load(“connectors/guarda_client.php…”)

combo still not have options, but value from server in xml is “1”
okey, form set this value to item - you see “1” in a dropdown box

then later when data loaded into form 1st combo “Pais” trigger onchange
event (it have connector and value from server set automaticaly by form that’s why you see it loaded)

dhxCmbpais.attachEvent(“onChange”, function(){ … }) this event was triggered
when “Pais” combo loaded. inside it you load dhxCmbcity combo
dhxCmbcity.loadXML(“connectors/obtenerciudades.php?id=”+cmbPaisID);

this functionality just add new values into list of opts (you don’t have any “selected” option in xml)

in other words:

form init →
pais_combo have connector, ciudad not →
loading form values (connectors/guarda_client.php) →
(connector + loaded value = pais combo works fine) (p.1) →
(value + (no_opts_in_conf || no_connector) = ciudad combo have only value w/o opts →
p.1 triggered onchange (another thread) →
ciudad combo loadXML →
ciudad: opts list loaded, combo will not change already entered value (loaded “1” is value not id) →
finaly you have form loaded, ciudad with opts but incorrect value

possible solution (one of them):

follow the logic of your app, I can suggest the following:
call set value for form after opts loaded into ciudad combo, i.e.

dhxCmbcity.loadXML(“connectors/obtenerciudades.php?id=”+cmbPaisID, function(){
edFrmClnt.setItemValue(“ciudadID”, edFrmClnt.getItemValue(“ciudadID”)); // magic
});

not very good solution but should work
the same for distribuidorID, line below

You can call it in the main Menu in “Bitacora”

grid have columns “ro”, in this case value from xml will exactly the same
(i.e. grid.setDateFormat not affected, see screenshot “grid_dates”)

you can use calendar “dhxCalendarA” cell type or like this,
but if you want r/o cell you can attachEvent(“onEdit”,function(){return false;})
“return false” will not allow to edit i.e. showing calendar, check our docs for details