Call method from template using template value as parameter

2 posts, 0 answers
  1. Cool Breeze
    Cool Breeze avatar
    44 posts
    Member since:
    Jan 2014

    Posted 03 Nov 2014 Link to this post


    I'm trying to convert the following element of a dynamic table into a template for a list view but am not sure how to go about passing the template value to the function in order to get the correct display value.

    Here is the HTML version:

        <td colspan="4" style="padding-left:10px; font-weight:bold; font-size:larger">
                var orderStatus = EnumHelper<OrderStatuses>.GetDisplayValue(order.OrderStatus);

    My issue is getting the OrderStatus passed into the EnumHelper method.

        <td colspan="4" style="padding-left:10px; font-weight:bold; font-size:larger">
                var orderStatusDescription = EnumHelper<OrderStatuses>.GetDisplayValue(#=OrderStatus#);

    What would the syntax be for this type of scenario or is it not supported (or is there a better way)?


  2. Petyo
    Petyo avatar
    2444 posts

    Posted 05 Nov 2014 Link to this post

    Hello Joe,

    the helper method is executed on the server, and the #= # interpolation occurs on the client. You should port your helper methods to the client, so that you can do something like this:

    #= getDisplayValue(OrderStatus) #.  

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top