Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Example php mysql

  1. #1
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default Example php mysql

    Hi all,

    I will be create tree panel
    I read this post http://extjs.com/forum/showthread.php?t=10082
    but I don't arrive
    Help me please
    if you have an example to give me

    thank you
    waxx

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    or how about looking at the Ext JS tree examples??

  3. #3
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default

    jgarcia

    I'm looking the post http://extjs.com/forum/showthread.php?t=10082
    And the examples of site.
    But I don't find a example for tree panel and mysql

    Waxx

  4. #4
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default

    Hi,
    I have a error when execute my tree panel
    this.root is not undefined

    where is my error please
    index.html
    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Customizing TreePanel</title>
    <link rel="stylesheet" type="text/css" href="../lib/ext/resources/css/ext-all.css" />
    
        <!-- GC -->
         <!-- LIBS -->
         <script type="text/javascript" src="../lib/ext/adapter/ext/ext-base.js"></script>
         <!-- ENDLIBS -->
    
        <script type="text/javascript" src="../lib/ext/ext-all.js"></script>
    
        <script type="text/javascript" src="ColumnNodeUI.js"></script>
        <script type="text/javascript" src="column-tree.js"></script>
    
        <!-- Common Styles for the examples -->
        
    
        <link rel="stylesheet" type="text/css" href="column-tree.css" />
    </head>
    <body>
    
    
    </body>
    </html>
    menu.js
    Code:
    var TreeTest = function(){
        // shorthand
        var Tree = Ext.tree;
        
        return {
            init : function(){
                // yui-ext tree
                var tree = new Tree.TreePanel('tree', {
                    animate:true, 
                    loader: new Tree.TreeLoader({dataUrl:'arborescence.php'}),
                    containerScroll: true,
                });
                
                // add a tree sorter in folder mode
                
                // set the root node
                var root = new Tree.AsyncTreeNode({
                    text: 'Menu', 
                    draggable:false, // disable root node dragging
                    id:'source'
                });
    
                tree.setRootNode(root);
                
                tree.render();
                
                root.expand(false,false);
            }
        };
    }();
    
    
    
    Ext.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);
    arborescence.php

    Code:
    <?php
    include_once($GLOBALS["DOCUMENT_ROOT"].'/db.php');
            $sql = "SELECT name,id FROM docfolders WHERE inheritaccess=0 order by id";
            $result = $db->query($sql);
             while ($obj = $result->FetchRow()){
                 
           //      $children = getChild($obj->id);
    
            
                    $tmp['text']               =    $obj['name'];
                    $tmp['id']                =    $obj['id'];
                    $tmp['leaf']            =    false;
                    $tmp['cls']                =    'folder';
                    $nodes[] = $tmp;
            }
            print json_encode($nodes);
    
        
    ?>
    thank

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Code:
                var root = new Tree.AsyncTreeNode({
                    text: 'Menu', 
                    draggable:false, // disable root node dragging
                    id:'source'
                });
    
                var tree = new Tree.TreePanel({
                    renderTo : 'tree',
                    animate:true, 
                    loader: new Tree.TreeLoader({dataUrl:'arborescence.php'}),
                    containerScroll: true,
                    root: root
                 });
    try that

  6. #6
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default

    Yes
    Thank you
    you can guide me to recover the children.

    still thank you

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    what doe syour tree json render to?

  8. #8
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default

    I made that a query principally for the folder

    Code:
    [{"text":"doc1","id":"0","leaf":false,"cls":"folder"},{"text":"doc2","id":"1","leaf"
    :false,"cls":"folder"}]
    I know that I must create for the files
    but my probleme I have several levels before my files

    Have you a exemple ??
    thank you
    waxx

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    does the request for the loader fire?

  10. #10
    Ext User
    Join Date
    Jul 2009
    Location
    FRANCE
    Posts
    15

    Default

    jgarcia
    I load the information of the parent directory.
    have you a exemple for the files ?? please
    thank
    waxx

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •