jquery - Click event lost after telerik grid sorting -


i have telerik extension grid sorting enabled. each row has link 'approve' shows modal popup when clicked. have created link using template,

   columns.bound(o => o.userseq).template(        @<text>           @html.actionlink("approve", "approveuser", "home", new { userseq = @item.userseq }, new { @class = "modal-link" })               </text> .clienttemplate(      <a href=" + url.action("approveuser", "home", new { userseq = "<#= userseq #>" }, null) + " class='modal-link'> approve </a>"                                 ).title("action").width(100); 

my problem modal pop appears separate page when link 'approve' clicked after grid sorting. works fine before sorting grid.

after research, found maybe need rebind click event show modal , after sorting. but, not sure how that.

i trying rebind click event "approve" link, after each column header of grid clicked sorting. far, can track when sort column clicked. but, issue cannot trigger event on clicking link 'approve' after sorting.

 $('.modal-link').bind('click', function () {                  alert('outbound');              });               $(".t-header .t-link").on('click', function () {                  alert('test');                  $('.modal-link').bind('click', function () {                      alert('bound');                  }); 

please help!

i found workaround issue. on click of link, need add html attributes link. so, instead of trying on rebind of click event, added html attributes link in client template while defining telerik grid in view.

  .clienttemplate(      <a href=" + url.action("approveuser", "home", new { userseq = "<#= userseq #>" }, null) + " **data-target='#modal-container' data-toggle='modal'** class='modal-link'> approve </a>"   ).title("action").width(100); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -