Exemple #1
0
<?php

ini_set("display_errors", 1);
require_once '../../../jq-config.php';
// include the driver class
require_once ABSPATH . "php/jqGridPdo.php";
// include the jqGrid Class
require_once ABSPATH . "php/jqTreeGrid.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 jqTreeGrid instance
$tree = new jqTreeGrid($conn);
$tree->SelectCommand = "SELECT * FROM nested_category";
// set the table and primary key
$tree->table = 'nested_category';
$tree->setPrimaryKeyId('category_id');
// set tree model and table configuration
$tree->setTreeModel('nested');
$tree->setTableConfig(array('id' => 'category_id', 'left' => 'lft', 'right' => 'rgt'));
// autoloading is disabled
$tree->autoLoadNodes = false;
// collapse all nodes (default)
$tree->expandAll = true;
// show any error (if any ) from server
$tree->showError = true;
$tree->setColModel();
$tree->setUrl('treegrid.php');
$tree->dataType = 'json';
// Some nice setting
Exemple #2
0
<?php

ini_set("display_errors", 1);
require_once '../../../jq-config.php';
// include the driver class
require_once ABSPATH . "php/jqGridPdo.php";
// include the jqGrid Class
require_once ABSPATH . "php/jqTreeGrid.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 jqTreeGrid instance
$tree = new jqTreeGrid($conn);
$tree->SelectCommand = "SELECT * FROM adj_table";
// set the table and primary key
$tree->table = 'adj_table';
$tree->setPrimaryKeyId('emp_id');
// set tree model and table configuration
$tree->setTreeModel('adjacency');
$tree->setTableConfig(array('id' => 'emp_id', 'parent' => 'boss_id'));
// autoloading is disabled
$tree->autoLoadNodes = false;
// collapse all nodes (default)
$tree->expandAll = true;
// show any error (if any ) from server
$tree->showError = true;
$tree->setColModel();
$tree->setUrl('treegrid.php');
$tree->dataType = 'json';
// Some nice setting
Exemple #3
0
<?php

ini_set("display_errors", 1);
require_once '../../../jq-config.php';
// include the driver class
require_once ABSPATH . "php/jqGridPdo.php";
// include the jqGrid Class
require_once ABSPATH . "php/jqTreeGrid.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 jqTreeGrid instance
$tree = new jqTreeGrid($conn);
$tree->SelectCommand = "SELECT * FROM accounts";
// set the table and primary key
$tree->table = 'accounts';
$tree->setPrimaryKeyId('account_id');
// set tree model and table configuration
$tree->setTreeModel('adjacency');
$tree->setTableConfig(array('id' => 'account_id', 'parent' => 'parent_id'));
// autoloading is disabled
$tree->autoLoadNodes = false;
// collapse all nodes (default)
$tree->expandAll = true;
// show any error (if any ) from server
$tree->showError = true;
$tree->setColModel();
$tree->setUrl('treegrid.php');
$tree->dataType = 'json';
// Some nice setting