1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    48
    Vote Rating
    0
    eaglefox12 is on a distinguished road

      0  

    Default Answered: Tooltip on Tree parentNode

    Answered: Tooltip on Tree parentNode


    the reqular data-qtip does work on my treepanel... but it shows up on all leafs too. How to check if the mouseover is on the parentNode... I am doing this on the listener of treePanel... is there a method that has isParentNode = true... that way I can just hide or show the tooltip accordingly

  2. Add a listener to your tree like this:

    Code:
    listeners: {
        itemmouseenter: function (view, rec) {
            console.log(rec.isLeaf());
        }
    }
    The second param passed is the record (nodeInterface).

    example:
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true },
                    { text: "alegrbra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        store: store,
        rootVisible: false,
        renderTo: Ext.getBody()
        , listeners: {
            itemmouseenter: function (view, rec) {
                console.log(rec.isLeaf());
            }
        }
    });

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    Answers
    476
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    48
    Vote Rating
    0
    eaglefox12 is on a distinguished road

      0  

    Default


    I was thinking the same, but how do we get the value in itemmouseover
    Code:
    itemmouseenter: function (e, t) {
                        var v = Ext.getCmp('myTree').isleaf();
                        console.log(v);
                    }
    I am doing this and it's giving me an error

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    Answers
    476
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Add a listener to your tree like this:

    Code:
    listeners: {
        itemmouseenter: function (view, rec) {
            console.log(rec.isLeaf());
        }
    }
    The second param passed is the record (nodeInterface).

    example:
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true },
                    { text: "alegrbra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        store: store,
        rootVisible: false,
        renderTo: Ext.getBody()
        , listeners: {
            itemmouseenter: function (view, rec) {
                console.log(rec.isLeaf());
            }
        }
    });

  6. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    48
    Vote Rating
    0
    eaglefox12 is on a distinguished road

      0  

    Default


    ... thank you slemmon... you are aweome

    Quote Originally Posted by slemmon View Post
    Add a listener to your tree like this:

    Code:
    listeners: {
        itemmouseenter: function (view, rec) {
            console.log(rec.isLeaf());
        }
    }
    The second param passed is the record (nodeInterface).

    example:
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true },
                    { text: "alegrbra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        store: store,
        rootVisible: false,
        renderTo: Ext.getBody()
        , listeners: {
            itemmouseenter: function (view, rec) {
                console.log(rec.isLeaf());
            }
        }
    });

Thread Participants: 1

Tags for this Thread