there was an error
I create new module : milkshake I want this menu show my table node
function milkshake_list($type) {
$output = t('This page contains our example form.').'
';
require_once "sites/all/libraries/jqgrid/jq-config.php";
require_once "sites/all/libraries/jqgrid/php/jqGrid.php";
require_once "sites/all/libraries/jqgrid/php/jqGridPdo.php";
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
$grid->debug = true;
$grid->showError = true;
//$grid->logtofile = false;
$grid->SelectCommand = 'SELECT * FROM node';
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->table = 'node';
$grid->setPrimaryKeyId('nid');
$grid->serialKey = false;
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('/list/fruity');
// Set grid caption using the option caption
$grid->setGridOptions(array(
"caption"=>"Drupal Node Table",
"rownumbers"=>true,
"rownumWidth"=>35,
"rowNum"=>10,
"sortname"=>"nid",
"hoverrows"=>true,
"rowList"=>array(10,20,50),
"width"=>700,
"height"=>240,
));
if (arg(1) == 1) {
$output .= $grid->renderGrid("#grid","#pager",true,null,null,true,true,true);
} else {
$output .= $grid->renderGrid("#grid","#pager",true,null,null,true,true,false);
}
$output.='
'.t('List @type flavors', array('@type' => $type)).$grid->showError ;
$conn = null;
return $output;
}
in jq-config
// ** MySQL settings ** //
//define('DB_NAME', 'northwind');
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top