[英]Gridview Column Resize issue with updatepanel
I want to auto resize column feature for asp.net gridview. 我想为asp.net gridview自动调整列功能的大小。 I am using colResizable-1.3.min.js for column resize functionality and its working fine. 我正在使用colResizable-1.3.min.js进行列大小调整功能及其正常工作。 but when i tried to add gridview with update panel then jquery does not work. 但是,当我尝试使用更新面板添加gridview时,jQuery无法正常工作。 its just working on postback request. 它只是在回发请求上工作。
Thanks 谢谢
<script>
//On Page Load
$(function () {
$('#<%=gvInv_ReceiveVoucherItem.ClientID %>').colResizable({
liveDrag: true,
gripInnerHtml: "<div class='grip'></div>",
draggingClass: "dragging",
postbackSafe: true,
partialRefresh: true
});
});
//On UpdatePanel Refresh
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
$('#<%=gvInv_ReceiveVoucherItem.ClientID %>').colResizable({
liveDrag: true,
gripInnerHtml: "<div class='grip'></div>",
draggingClass: "dragging",
postbackSafe: true,
partialRefresh: true
});
}
});
};
</script>
</Columns>
</asp:GridView>
</asp:Panel>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.