[CLOSED] Tree Panel Razor View Example?

  1. #1

    [CLOSED] Tree Panel Razor View Example?

    Hi there,

    I need to create a tree panel (in a razor view page) but can't figure out the syntax - I can't find a way to achieve the
    <Root>
          <ext:Node>
                  <Children>
                         <ext:Node>
    part of the structure. Any chance of an example of how to create a tree panel in razor view syntax? Specifically how to create the nodes/children?

    thanks
    Last edited by Daniil; Mar 05, 2012 at 6:13 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Unfortunately, Developer Preview 1 doesn't allow it
    We added that option to SVN already, please wait Beta release (should be soon)

    Here is a sample
    @(Html.X().TreePanel()
          .Root(root => (
              root.Add(new Node{
                Text = "Root"
              });    
          ))
      )
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    I assume this is the same case with many of the controls? It appears you can't add items to combo boxes etc. either in Razor view?
  4. #4
    Hi,

    We will appreciate if you post all known problems with Razor, it will allow us to fix it before beta release
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    The others I've noticed so far are the combobox and multibox don't appear to have items collections exposed so its not possible to add anything to them.
  6. #6
    Items of Combobox/MultiSelect are now supported by Razor engine
    It will be availbale in next beta release
    Vladimir Shcheglov
    Sr. Developer
  7. #7
    Quote Originally Posted by Vladimir View Post
    Unfortunately, Developer Preview 1 doesn't allow it
    We added that option to SVN already, please wait Beta release (should be soon)

    Here is a sample
    @(Html.X().TreePanel()
          .Root(root => (
              root.Add(new Node{
                Text = "Root"
              });    
          ))
      )
    Sorry - I'm having a little bit of trouble with this. What is the syntax to then add child elements to the root node?
  8. #8
    Here you are.

    Example
    @{
        Layout = "";    
    }
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>
    </head>
    <body>
        @Html.X().ResourceManager()
        
        @(Html.X().TreePanel()
            .Height(200)
            .Root(root =>
            {
                root.Add(new Node
                {
                    Text = "Root"
                });
                root[0].Children.Add(new Node()
                {
                    Text = "Node 1",
                    Leaf = true
                });
                root[0].Children.Add(new Node()
                {
                    Text = "Node 2",
                    Leaf = true
                });
            })
        )
    </body>
    </html>

Similar Threads

  1. Replies: 1
    Last Post: Oct 26, 2012, 9:52 AM
  2. Replies: 4
    Last Post: Apr 09, 2012, 3:10 PM
  3. [CLOSED] Listeners for Tree Panel (Razor Views)
    By machinableed in forum 2.x Premium Help
    Replies: 24
    Last Post: Apr 04, 2012, 8:56 AM
  4. Replies: 2
    Last Post: Mar 13, 2012, 11:23 AM
  5. [CLOSED] Adding tree view to panel?
    By Jurke in forum 1.x Premium Help
    Replies: 3
    Last Post: Dec 09, 2008, 12:27 PM

Tags for this Thread

Posting Permissions