Hello,
I have a problem with a grid which use JQUERY UI Timepicker.
In a form edit, I can open my date-timepicker by a click on a “date field”.
But if I change the property of my ID field ( primary key; Auto complete, INT) by hidden=> true, my timepicker don’t appear in my “date field”. The probleme is only with this field.
If I change the same property of an other field, I have no problem to use the timepicker.
I noticed: If I change the place of my “date field” in my query when the ID is hidden, the “date field” is not in the first place in the form, and the timepicker appear. I find it’s a problem with the focus, but I don’t know how to solve that.
What do you think about this ?
King regards,
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
<?php // Load des parametres de connexion require_once '../rex_at-config.php'; // Load des Class jqGrid require_once "../../php/PHPSuito/jqGrid.php"; // Load des paramétres PDO pour jqGrid require_once "../../php/PHPSuito/DBdrivers/jqGridPdo.php"; // Connexion au serveur $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD); // Déclaration du format UTF-8 de la BDD $conn->query("SET NAMES utf8"); // Création d'une instance jqGrid $grid = new jqGridRender($conn); // Parametrage de l'export CSV $grid->setCsvOptions(array("separator" =>",","file" =>"mycsvfile.csv")); // Activation du mode debug $grid->debug = false; // Load de la requête SQL $grid->SelectCommand = " SELECT id_at, type, date_at, uo_poles, unites, description, commentaires, nom, prenom, CP, jeune_embauche, arret, duree_arret, code1, code2, lesion, siege, epi, DPA_trait, DPA_valid FROM rex_at"; // Déclaration de la table MaJ $grid->table = 'rex_at'; // Définition d'une clé primaire $grid->setPrimaryKeyId('id_at'); $grid->serialKey = false; //Déclaration du format d'échange $grid->dataType = 'json'; // Déclaration du model du grid $grid->setColModel(); // Déclaration du fichier de chargement de données $grid->setUrl('grid_rex_at.php'); // Déclaration d'autres options $grid->setGridOptions(array( "caption"=>"Saisie REX des AT TMV ", // Titre du tableau "rowNum"=>15, // Nombre de lignes par défaut à afficher "rowList"=>array(20,35,50), // Déclaration du nombres de lignes affichables "sortname"=>"date_at", // Déclaration du tri par défaut "sortorder"=>"desc", "width"=>1800, "height"=>"Auto", // Hauteur automatique du tableau "hoverrows"=>true // highlight la ligne survolée )); // **************************************** // Règle d'édition des champs par défaut $grid->setColProperty('id_at', array("hidden"=>true)); // **************************************** // Date options to edit $grid->setColProperty('date_at', array("label"=>"Date modif","align"=>"center", "width"=>190,"formatter"=>"date", "formatoptions"=>array("reformatAfterEdit"=>true, "srcformat"=>"Y-m-d H:i:s", "newformat"=>"m/d/Y H:i"), // Ok. We use some trick here to create the datepicer on dataInit event // when the element is created. Note the js: before the function. // this instruct the grid to put a javascript code without additional formating "editoptions"=>array("dataInit"=> "js:function(elm){setTimeout(function(){ jQuery(elm).datetimepicker({dateFormat:'mm/dd/yy'}); jQuery('.ui-datepicker').css({'font-size':'75%'}); },200);}") )); $grid->setDbTime('Y-m-d H:i:s'); $grid->setUserTime("m/d/Y H:i"); // **************************************** // **************************************** // Configuration du navigateur $grid->navigator = true; // Activer le navigateur CRUD $grid->setNavOptions('navigator', array("excel"=>true,"pdf"=>true,"add"=>true,"edit"=>true,"del"=>true,"view"=>true, "search"=>true)); // Déclaration des options de la barre des tâches CRUD $grid->setNavOptions('edit', array("height"=>'auto',"dataheight"=>"auto","width"=>'auto',"closeAfterEdit" => true)); // Paramètre du formulaire d'édition $grid->setNavOptions('add', array("addCaption"=>"Nouvelle fiche retard","closeAfterAdd"=>true,"height"=>'auto',"dataheight"=>"auto","width"=>'auto')); // Paramètre du formulaire de création // *************************************** // Parametrage des export Excel et PDF $grid->exportfile = 'Export_retard_tmv.xls'; // Définition du nom du fichier d'export Excel $oper = jqGridUtils::GetParam("oper"); // Parametre d'exportation PDF if($oper == "pdf") { $grid->setPdfOptions(array( "page_orientation"=>"L", // Orientation de la page en paysage "L" ou portrait "P" "header"=>true, // Activation d'un entête "margin_top"=>20, // Déclaration d'une en-tete de haut de page "margin_bottom"=>0, // Déclaration d'une en-tete de bas de page "margin_footer"=>5, "header_logo"=>"logo.gif", // Nom d'un logo dans répertioire PDF php/ tcpdf "header_logo_width"=>20, //Déclaration de la largeur du logo "header_title"=>"Export retard sortie de site", // Titre de l'en-tête "shrink_cell"=>false, // Activation/Desactivation du tassement des valeurs "encoding" => "UTF-8", // Encodage UTF-8 "reprint_grid_header"=>true, // Affichage des titres de colonnes sur chaque page "header_string"=>"Technicentre de Villeneuve" // Texte d'en-tête à imprimer )); } //********************************* // Paramètre de rendu du Grid $grid->renderGrid('#test1','#pager',true, null, null, true,true); ?> |
Jqgrid PHP 5.1.0
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top