开发者

How to add the javascript in display tag sort event?

开发者 https://www.devze.com 2023-01-21 14:51 出处:网络
Hi i am using display tag to display the data. on clicki开发者_运维技巧ng on the table header link it should call the javascript and submits the page instead of navigation to it. how to do it?In the O

Hi i am using display tag to display the data. on clicki开发者_运维技巧ng on the table header link it should call the javascript and submits the page instead of navigation to it. how to do it?


In the Onload of the page, seach for the sort column and add the script to submit the page as follows,

 $(document).ready(function() {
                    $('.sortable').each(function(event){ 
                     var obj = $(this).find('a').attr('href'); 
                var urltext = 'javascript:submitform("'+contextPath+'/'+obj+'\")';  
                $(this).find('a').attr('href', urltext);
            }); 
      });   
0

精彩评论

暂无评论...
验证码 换一张
取 消