Forum
Topic RSS
08:38
26/05/2010
OfflineHello,
Are you talking about Form function ?
In this case you could use Jquery maskedinput plugin, see at :
11:26
05/10/2011
OfflineThe code of my jqgrid "grid.php" is:
CODE:
<?php
require_once '../../../jq-config.php';
// include the jqGrid Class
require_once ABSPATH."php/jqGrid.php";
// include the driver class
require_once ABSPATH."php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
//$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT coddelegacion, descdelegacion, domiciliodelegacion, poblaciondelegacion, codpostaldelegacion, provinciadelegacion, telefonodelegacion, faxdelegacion, emaildelegacion FROM gestdelegaciones001';
// Set the table to where you add the data
$grid->table = 'gestdelegaciones001';
$grid->setPrimaryKeyId('coddelegacion');
$grid->serialKey = false;
// Set output format to json
$grid->dataType = 'json';
//Validacion
$checkTelefono = <<<CHECKER
function checkTel(value, colname) {
if (value.length==9)
return [true,""];
else
return [false,"El teléfono debe tener 9 dígitos"];
}
CHECKER;
// Let the grid create the model
$grid->setColModel();
$grid->setColProperty("coddelegacion", array("label"=>"Codigo", "width"=>60, "readonly"=>true, "editable"=>false));
$grid->setColProperty("descdelegacion", array("label"=>"Delegacion", "width"=>120));
$grid->setColProperty("domiciliodelegacion", array("label"=>"Domicilio", "width"=>100));
$grid->setColProperty("poblaciondelegacion", array("label"=>"Poblacion", "width"=>80));
$grid->setColProperty("provinciadelegacion", array("label"=>"Provincia", "width"=>80));
$grid->setSelect("provinciadelegacion","SELECT DISTINCT IDPROVINCIA, DESCPROVINCIA FROM gestprovin001 ORDER BY DESCPROVINCIA", true, true, false);
$grid->setColProperty("codpostaldelegacion", array("label"=>"CPostal", "width"=>70,"editrules"=>array("required"=>true, "number"=>true, "integer"=>true)));
$grid->setColProperty("telefonodelegacion",
array("label"=>"Telefono", "width"=>90,
"formatoptions"=>array("srcformat"=>"Y-m-d H:i:s", "newformat"=>"Y-m-d"),
"editrules"=>array
(
"required"=>true, "number"=>true, "integer"=>true, "custom"=>true, "custom_func"=>"js:".$checkTelefono
),
"editoptions"=>array("dataInit"=>"js:function(elm){jQuery(elm).mask('(999) 999-9999');}")
));
//$grid->setColProperty('telefonodelegacion',array("formoptions"=>array("rowpos"=>3,"colpos"=>2)));
$grid->setColProperty("faxdelegacion", array("label"=>"Fax", "width"=>90, "editoptions"=>array("maxlength"=>9)));
$grid->setColProperty("emaildelegacion", array("label"=>"Email", "width"=>200, "editrules"=>array("required"=>true, "email"=>true)));
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array(
"rowNum"=>10,
"rowList"=>array(10,20,30),
"sortname"=>"coddelegacion",
"multiselect"=>true
));
// The primary key should be entered
$grid->setColProperty('descdelegacion', array("editrules"=>array("required"=>true)));
// Enable navigator
$grid->navigator = true;
// Enable only deleting
$grid->setNavOptions('navigator', array("csv"=>true, "pdf"=>true, "excel"=>false,"add"=>true,"edit"=>true,"del"=>true,"view"=>true, "search"=>false));
$grid->setNavOptions('edit',array("closeAfterEdit"=>true,"width"=>300,"height"=>280,"dataheight"=>220));
$grid->setNavOptions('add',array("closeAfterAdd"=>true,"width"=>300,"height"=>280,"dataheight"=>220));
//Opciones PDF
$oper = jqGridUtils::GetParam("oper");
// prevent some executions when not excel export
if($oper == "pdf") {
$grid->setPdfOptions(array(
// enable header information
"header"=>true,
// set bigger top margin
"margin_top"=>27,
//header title
"header_title"=>"e-Project",
// and a header string to print
"header_string"=>"GESTION DELEGACIONES EULEN"
));
}
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;
?>
And i obtain the next error code:
ERROR: The object does not accept this property or method
Thank you for your help!!
09:18
26/05/2010
OfflineHmmmm,
I'm using Javascript Grid and developped custom PHP Grid than i think than i could help you 🙂
I suppose than you error is a javascript error.
Well,
Remove this part opf your code :
,
"editoptions"=>array("dataInit"=>"js:function(elm){jQuery(elm).mask('(999) 999-9999');}"
Try if you've got always your problem :
- If not, it seems than Jquery mask plugin doesn't exist in your page, check if it's true. The code "
<script src="jquery.maskedinput.js" type="text/javascript"></script>" need to be present 🙂
- If true, i don't know.... :s
Most Users Ever Online: 994
Currently Online:
15 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home