Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
jqgrid with drupal
17/07/2011
15:42
Avatar
m2jalali
New Member
Members
Forum Posts: 1
Member Since:
17/07/2011
sp_UserOfflineSmall Offline

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.').'<br>';
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.='<hr>'.t('List @type flavors', array('@type' => $type)).$grid->showError ;
$conn = null;
return $output;
}

in jq-config

<?php
// ** MySQL settings ** //
//define('DB_NAME', 'northwind');    // The name of the database
//define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_DSN','mysql:host=localhost;dbname=conch');
define('DB_USER', 'root');     // Your MySQL username
define('DB_PASSWORD', ''); // ...and password

define('ABSPATH', dirname(__FILE__).'/');
//require_once(ABSPATH.'tabs.php');
?>

output there was an error $grid->showError=1
How Do i correct...?
Please guide me

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
41 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information