Context menu on tree grid

Page 1 of 3 123 LastLast
  1. #1

    Context menu on tree grid

    Hi friends,

    I am using context menu for tree grid. The tree grid has four levels of nodes. I want to show different context menu items for different level.
    I mean i want to make it visible and hide some menu items at different levels.

    currently i am checking whether the node is leaf or not, based on that i am showing different context menu items.
    this link helped me to do this..

    http://forums.ext.net/showthread.php...the-Tree-panel

    But i want to show other menu items in the middle nodes..


    How can i do this.. Please provide some sample on it..

    Thank you.
  2. #2
    Hi,

    As far as I can understand you should analyze a node's children
    http://docs.sencha.com/ext-js/3-4/#!...rty-childNodes
    to determine a node's level.
  3. #3
    Thanks danill.. i will go through the link.

    Is it possible to provide check box nodes at one level to select multiple values.
    I want to provide user, the ability to select multiple values only at one level(let say at level 3) and i have to get the selected node ids when the user clicks on the context menu item.

    Is it possible? if yes please can you provide some sample to do this

    Thank you.
  4. #4
    Is it possible to provide check box nodes at one level to select multiple values.
    The following example should help.
    http://forums.ext.net/showthread.php?13047

    Please note that a checkbox is rendered only if you set up Checked for a node.
  5. #5
    Hi danill thanks for the reply.

    I saw the like you provided but in my case user should be able to select multiple values only at one level. In the remaining levels he should be able to select single node like normal treegrid without multiple selections.

    I am loading my treegrid data asynchronously. How can i achieve this?


    Thank you.
  6. #6
    Well, I know that the example I referred is not exactly that you need. I hoped that it helped you to start.

    Please clarify what is a problem to don't check a node if it's on a "wrong" level?

    Just don't call
    node.ui.toggleCheck(checked);
    for that node.

    Another task - determining a node's level.

    The TreeNode API should help.
    http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Node
    http://docs.sencha.com/ext-js/3-4/#!....tree.TreeNode
  7. #7
    Quote Originally Posted by Daniil View Post
    Please clarify what is a problem to don't check a node if it's on a "wrong" level?
    Hi Danill, thanks for the reply
    I might failed to explained it properly. Here what i need to implement.
    I have a treegrid which has four levels. Based on the level i have to show different context menu items to perform some task based on the nodeid.

    Except third level user should be able to click on the node and get context menu and click on the context menu item to perform some task.

    For third level user should have the provision to select multiple nodes(check boxes should appear only on third level) and this third level also user should have different context menu item (when the user clicks on context menu item on this level i have to pass all selected node ids in this level).

    Fourth level is leaf nodes. here user should not have the provision to select multiple values because the context menu in this level required only one nodeid to perform some other task.

    I hope i made it clear.. Can you tell me how can i achieve this

    currently i am able to get different context menu items by checking whether the node is leaf or not. now i want check boxes only on the third level and get those selected nodes when the user clicks on the context menu items

    Thank you.
  8. #8
    Well, it's hard to "tell" how to achieve that.

    I would suggest you to set up a custom attribute like "level" for each node.

    Then you can easily determine a node's level.
  9. #9
    Quote Originally Posted by Daniil View Post
    The following example should help.
    http://forums.ext.net/showthread.php?13047

    Please note that a checkbox is rendered only if you set up Checked for a node.
    Hi danill, thank for the reply.

    I got some idea to achieve my task now. i am appending one value to node id to determine what is the node level.

    I also went through the link you provided. the example you provided on the link is not working properly.
    I mean when the user clicks on the root node all its child nodes are checked but if i uncheck any of the child nodes the root should be uncheck (which means all child nodes are not checked).

    If i select second level root node then all child nodes of the node are not checked. Is it possible to do that?

    If yes please provide full working sample like the way gridpanel checkbox selection model works...

    thank you.
    Last edited by Mr.Techno; Nov 15, 2011 at 10:12 AM.
  10. #10
    Unfortunately, I'm too busy here to prepare a full example, your requirements are not so easy.

    But I would answer on more concrete questions.

    What did you already implement and where exactly did you stop?
Page 1 of 3 123 LastLast

Similar Threads

  1. [CLOSED] Multiselect on grid with context menu
    By stoque in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 27, 2012, 4:28 PM
  2. Replies: 1
    Last Post: Mar 26, 2012, 6:11 PM
  3. Replies: 1
    Last Post: Feb 17, 2012, 12:38 PM
  4. [CLOSED] Context Menu in the tree is not seen, it shows the shadow
    By Shanth in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 21, 2011, 2:05 PM
  5. [CLOSED] Context Menu in the Tree panel
    By Shanth in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 23, 2011, 2:02 PM

Tags for this Thread

Posting Permissions