We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

from "text / x-jsrender" script, how I can send a function defined within the angular range, not a function outside but within a defined angular

Thread ID:

Created:

Updated:

Platform:

Replies:

127177 Oct 31,2016 08:38 PM UTC Nov 1,2016 05:34 PM UTC JavaScript 1
loading
Tags: ejTreeGrid
Daniel
Asked On October 31, 2016 08:38 PM UTC

from "text / x-jsrender" script, how I can send a function defined within the angular range, not a function outside but within a defined angular

Attachment: Sync_575cbd70.7z

Jonesherine Stephen [Syncfusion]
Replied On November 1, 2016 05:34 PM UTC

Hi Daniel, 
We need to use the type="text/ng-template" script to render the TreeGrid template using angularJS. We have prepared the work around and rendered the custom column in TreeGrid by using “columnTemplate” property. And also rendered the button in a custom field using template and bind the event for button click action. 
Please find the code example below: 
<script type="text/ng-template" id="columnTemplate"> 
        <div> 
            <button ng-click="$parent.clickme()" style="margin-left:5px">Click</button> 
        </div> 
    </script> 
<script> 
var columns = [     ///                      
    { field: "customfield", headerText: "Custom Field", isTemplateColumn: true, angularTemplate: "#columnTemplate" }, ] 
.controller('TreeGridCtrl', function ($scope) { 
            $scope.columns = columns; 
            //inline function for button click event 
            $scope.clickme = function () { 
                alert("We can customize the actions here") 
            } 
        }); 
</script> 
 
Please find the sample from below location. 
 
Regards, 
Jone sherine P S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;