abhinav30

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • in reply to: Search is not working in treegrid #124105
    abhinav30
    Participant

    Example in link doesn’t working … I entered “black” in ‘color’ column but nothing happened..I am expecting it will show only the rows with ‘color’ column as ‘black’

     

     

    in reply to: Creating TreeGrid from multiple tables #123996
    abhinav30
    Participant

    I was able to make it work but it worked only once and now its giving me the following error :

    <br />
    <b>Fatal error </b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes) in <b>C:\xampp\htdocs\Guriddo_Suito_PHP_4_8_2\php\PHPSuito\jqTreeGrid.php</b> on line <b> 5 </b> <br />

    Now coming back to real problem.
    For the table “Parent” mention below, “Parent” field is defined as  “NULL” so it is being treat as a leaf node but actually its got child which are defined in “Child” table (ID 101 and 102). Do I need to fake it somehow ?
    Table Parent :
    ID     |  Parent
    ———————
    1       | NULL
    2       | NULL
    Table :Child
    ID     |  Parent
    ———————
    1 01      | 1
    102      | 1
    201       | 2
    301       | NULL
    in reply to: Creating TreeGrid from multiple tables #123995
    abhinav30
    Participant

    sorry missed the data..

    Now data which I am getting is

    {“userdata”:[],”rows”:[{“ID”:”1″,”parent”:null,”level”:0,”isLeaf”:”true”,”loaded”:”true”,”expanded”:”true”},{“ID”:”1″,”parent”:null,”level”:0,”isLeaf”:”true”,”loaded”:”true”,”expanded”:”true”}],”total”:2,”page”:1}

     

    in reply to: Creating TreeGrid from multiple tables #123993
    abhinav30
    Participant

    Hello,

    I have tried both option

    Option 1 : I have replaced it with $tree->setTreeModel(‘adjacency’); but still my TreeGrid is empty.

    Option 2 : I tried  the fresh start , I have created two new files  with following content but nothing show up.

    treegrid.php

    myfirsttreegrid.php

    Thanks and Regards

    Hemadri

     

    • This reply was modified 6 years, 3 months ago by abhinav30.
    • This reply was modified 6 years, 3 months ago by tony. Reason: code formatting
    in reply to: Creating TreeGrid from multiple tables #123985
    abhinav30
    Participant

    Hello,

    Thanks for the response.I will give it a try.

    Started with my first grid. Data connection is OK. I can see data fetched from database in json format but still my grid is blank.

    Data displayed in jason as below:

    {“records”:0,”page”:0,”total”:0,”rows”:[{
    “ID”:1,”parent”:”0″},{“ID”:2,”parent”:”0″}]}

    Table Information :

    Name : parent

    Column : ID,parent

    Rows : (1,0)(2,0)

    Here is php code :

    <?php
    ini_set(“display_errors”,1);

    require_once ‘../jq-config.php’;
    // include the driver class
    require_once ABSPATH.”php/PHPSuito/DBdrivers/jqGridPdo.php”;
    // include the jqGrid Class
    require_once ABSPATH.”php/PHPSuito/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 parent”;

    // set the table and primary key
    $tree->table = ‘parent’;
    $tree->setPrimaryKeyId(‘ID’);
    // set tree model and table configuration
    $tree->setTreeModel(‘nested’);
    $tree->setTableConfig(array(‘id’=>’ID’, ‘left’=>’null’, ‘right’=>’null’,’level’=>’0′));

    // autoloading nodes
    $tree->autoLoadNodes = true;
    // show any error (if any ) from server
    $tree->showError = true;

    $tree->setColModel();

    $tree->setUrl(‘mygrid.php’);
    $tree->dataType = ‘json’;
    // Some nice setting
    $tree->setColProperty(‘ID’,array(“label”=>”ID”, “width”=>170));
    $tree->setColProperty(‘parent’,array(“label”=>”parent”, “width”=>170));

    // and finaly set the expand column and height to auto
    $tree->setGridOptions(array(
    “ExpandColumn”=>”ID”,
    “height”=>”auto”,
    “sortname”=>”ID”
    ));
    $tree->renderTree(‘#tree’, ‘#pager’, true,null, null, true, true);

     

     

    • This reply was modified 6 years, 3 months ago by abhinav30.
Viewing 5 replies - 1 through 5 (of 5 total)

Stay connected with us in your favorite flavor!