[CLOSED] template column rendering function of treegrid does not have access to Node

  1. #1

    [CLOSED] template column rendering function of treegrid does not have access to Node

    Hi,

    the example at https://examples2.ext.net/#/TreePane...nced/TreeGrid/

    shows how to use templatedcolumn on treegrid, however, in 3.1 we had access to the node property as shown in the code below

    
     var formatHours = function (v,node) {            if (v < 1) {                return Math.round(v * 60) + " mins";            } else if (Math.floor(v) !== v) {                var min = v - Math.floor(v);                return Math.floor(v) + "h " + Math.round(min * 60) + "m";            } else {                return v + " hour" + (v === 1 ? "" : "s");            }        };
    However, in V2 the function pass undefined for node.

    How can I access the node property of a treegrid when the template function is called as i need to check some properties of the node before generating the Html for the column.
    Last edited by Daniil; Aug 16, 2012 at 5:23 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please replace
    {duration:this.formatHours}
    with
    {[this.formatHours(values.duration, values)]}
    Then you will be able to access other node properties via the second argument.

Similar Threads

  1. Replies: 11
    Last Post: Nov 24, 2012, 4:50 AM
  2. Replies: 4
    Last Post: May 03, 2012, 8:11 PM
  3. How to get treegrid total node count.
    By bjones in forum 1.x Help
    Replies: 3
    Last Post: Jan 11, 2012, 5:42 PM
  4. TreeGrid - fore color of a node
    By Kedar in forum 1.x Help
    Replies: 1
    Last Post: Jan 11, 2011, 7:45 AM
  5. [CLOSED] Access TreeGrid nodes from DirectEvent handler
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Jun 28, 2010, 6:35 PM

Posting Permissions