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

AngularJS $scope variable in rowTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

120999 Nov 2,2015 11:10 AM UTC Nov 4,2015 07:01 AM UTC JavaScript 3
loading
Tags: ejGrid
Kéki Richárd
Asked On November 2, 2015 11:10 AM UTC

Hi,

I use a rowTemplate (see below) and I want to use a $scope.active variable in the link which is not in the datasource. How can I do that?
Thank you for any help you provide.

<script id="templateData" type="text/x-jsrender">
    <tr role="row" class="">
        <td role="gridcell" class="e-rowcell"><a rel='nofollow' href="teams/teamMembersList?szakosztaly={{:szakosztalyId}}&korosztaly={{:korosztalyId}}&csapat={{:csapatId}}&aktiv={{$scope.active}}">{{:csapatNev}}</a></td>
        <td role="gridcell" class="e-rowcell"><a rel='nofollow' href="userManagement/newUser/{{:edzoId}}">{{:edzoNeve}}</a></td>
        <td role="gridcell" class="e-rowcell">{{:versenyzo}}</td>
        <td role="gridcell" class="e-rowcell">{{:versenyzoFiu}}</td>
        <td role="gridcell" class="e-rowcell">{{:versenyzoLany}}</td>
        <td role="gridcell" class="e-rowcell">{{:megjegyzes}}</td>
    </tr>
</script>

Jayaprakash Kamaraj [Syncfusion]
Replied On November 3, 2015 09:46 AM UTC

Hi Kéki,

We considered the requirement “Angular template support in ejGrid rowTemplate” as a feature request and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents 


We have tried to achieve the requirement using angular templatecomplie method as a workaround which can be used to link scope and the template together.
Please find the code example and sample, 

<a class='bind' rel='nofollow' href="teams/teamMembersList?szakosztaly={{:EmployeeID}}&korosztaly={{:FirstName}}&csapat={{:LastName}}&aktiv= scopeVal">{{:City}}</a>
……
………….

…………….

$scope.compile = function (el) {
                                                               
                                                                el.each(function(index,obj){
                                                                                var s=$(obj).attr('rel='nofollow' href')
                                                                                $(obj).attr('rel='nofollow' href',s.replace('scopeVal','{{value}}'))
                                                                });
                                                               
                  $compile(el)($scope);
              }
               $scope.complete = function(args){ //grid actionComplete event
                 
                      templateCompile(args);
              }; 
        });
                                function templateCompile(args){
  var scope = angular.element($("#Grid")).scope();
              scope.compile($("#Grid").find('.bind'))//call the angular compile function
          }
 
Sample Link : http://www.syncfusion.com/downloads/support/forum/120999/ze/angular_with_scope_variable-1389030164
Regards,
Jayaprakash K.

Kéki Richárd
Replied On November 3, 2015 01:32 PM UTC

Hi,

Thank you for quick answer.
Your solution is working perfectly.

Thanks again,
Richárd Kéki

Jayaprakash Kamaraj [Syncfusion]
Replied On November 4, 2015 07:01 AM UTC

Hi Keki, 

We are happy that the provided suggestion helped you. 

Please get back to us if you need any further assistance.  

Regards, 

Jayaprakash K.



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

;