[CLOSED] [#1372] [4.1.0] NestedList - Icons

  1. #1

    [CLOSED] [#1372] [4.1.0] NestedList - Icons

    Is it possible to show the icons in the NestedList, eventually by defining a template for the nodes?
    @{ 
        var x = Html.X();
    }
    @(
        x.NestedList()
            .Store(c=> c.Add(x.TreeStore()
                .Root(x.Node()
                    .Children(
                        x.Node()
                            .Text("Node0")
                            .Icon(Icon.Brick)
                    )
                )
            ))
    )
    Last edited by fabricio.murta; Aug 22, 2016 at 3:00 AM.
  2. #2
    Hello @sveins12!

    Use you .Icon(<icon_here>) approach and add this to the NestedList definition:

            .CustomConfig(c => c.Add(
                new ConfigItem()
                {
                    Name = "ListConfig",
                    Value = "{ itemTpl: '<span class=\"{iconCls}\" style=\"float:left; width:20px; height:20px\"></span>{text}' }",
                    Mode = ParameterMode.Raw
                }
            ))
    Unfortunately I couldn't write the same using a better approach (aka .ListConfig()) but I'll give it a better look and create an issue if I am really unable to define the item template thru ListConfig directly.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello! Sorry for the late feedback. We actually investigated the issue and fixed it, allowing you to properly define the template to display the list item with an icon.

    Issue was #1372, addresses the problem with customizing the list items, and you can use it now instead of the workaround provided.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 1
    Last Post: Aug 15, 2016, 10:23 PM
  2. [CLOSED] Tab icons
    By prost in forum 2.x Premium Help
    Replies: 5
    Last Post: Nov 25, 2012, 9:29 PM
  3. Icons on the desktop
    By Yannis in forum 1.x Help
    Replies: 1
    Last Post: Feb 14, 2011, 9:04 PM
  4. Disabled Icons
    By GijsZePa in forum Bugs
    Replies: 2
    Last Post: Jun 25, 2010, 9:33 AM
  5. Replies: 0
    Last Post: Apr 03, 2009, 6:47 AM

Posting Permissions