admin管理员组文章数量:1396105
I have a issue with the sortable function of jQuery. When my page does a post-back with the update-panel the sorting of the dynamic table doesn't work anymore. The post-back is triggerd when a image-button is pushed. When the image-button is pushed there is a new row with a subtable in it.
I tried these 3 JavaScript codes but they all only seem to work for the first time. They DON'T work after I open the subtable.
Do you guys maybe know a JavaScript solution to solve this?
My first try:
$(function(){
$('table[id*="tbl_main"]').tablesorter();
});
My second try:
$(document).ready(function(){
$('table[id*="tbl_main"]').tablesorter();
});
My third try:
function pageLoad() {
$(function () {
$("#pager").unbind();
$('table[id*="tbl_main"]')
.tablesorter()
.tablesorterPager({ container: $("#pager") });
}
)}
I have a issue with the sortable function of jQuery. When my page does a post-back with the update-panel the sorting of the dynamic table doesn't work anymore. The post-back is triggerd when a image-button is pushed. When the image-button is pushed there is a new row with a subtable in it.
I tried these 3 JavaScript codes but they all only seem to work for the first time. They DON'T work after I open the subtable.
Do you guys maybe know a JavaScript solution to solve this?
My first try:
$(function(){
$('table[id*="tbl_main"]').tablesorter();
});
My second try:
$(document).ready(function(){
$('table[id*="tbl_main"]').tablesorter();
});
My third try:
function pageLoad() {
$(function () {
$("#pager").unbind();
$('table[id*="tbl_main"]')
.tablesorter()
.tablesorterPager({ container: $("#pager") });
}
)}
Share
Improve this question
edited Mar 19, 2013 at 11:05
Dipesh Parmar
27.4k8 gold badges64 silver badges92 bronze badges
asked Mar 19, 2013 at 11:00
FreddyFreddy
9801 gold badge22 silver badges46 bronze badges
1 Answer
Reset to default 10After each update all scripts are removed, you have to bind them again like:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<script type="text/javascript">
Sys.Application.add_load(BindFunctions);
</script>
...
And then in your javascript file:
function BindFunctions() {
$('table[id*="tbl_main"]').tablesorter();
};
本文标签: jQuery sorttable doens39t work after postback in updatepanel (JavaScript)Stack Overflow
版权声明:本文标题:jQuery sorttable doens't work after postback in updatepanel (JavaScript) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744125708a2591942.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论