Problem with template iside command

2 posts, 0 answers
  1. ulises
    ulises avatar
    2 posts
    Member since:
    Mar 2016

    Posted 12 Feb Link to this post

    Hello, I have a problem with my code.

    In mi command i try to use a template whit a "If" statement, but doesn't work, what is wrong? 

     

    command:
                                {
                                    text: "Work",
                                    click: function (e) {
                                        angular.copy(this.dataItem($(e.currentTarget).closest("tr")), vmOrd.DataRel);
                                        $scope.$broadcast('loadData', vmOrd.DataRel);                                   
                                        $scope.$apply();
                                    },
                                    template: '#if(Quantity != 0){# <a href="\\#" class="k-button k-button-icontext k-grid-Work"><span class="fa fa-2x fa fa-pencil-square-o text-default"></span></a> # } else {# <a href="\\#" class="k-button k-button-icontext k-grid-Work"><span class="fa fa-2x fa fa-pencil text-default"></span></a> #} #',
                                },

  2. Georgi
    Admin
    Georgi avatar
    221 posts

    Posted 14 Feb Link to this post

    Hello Ulises,

    Thank you for the provided code.

    I have tested the provided template and the condition works as expected on my end.

    Below you will find a sample which uses the provided template. Could you please examine it and let me know what I am missing?


    I look forward to your reply.


    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top