我想自动调整 asp.net gridview 的列功能。我正在使用 colResizable-1.3.min.js 来调整列大小功能并且它工作正常。但是当我尝试使用更新面板添加 gridview 时,jquery 不起作用。它只是处理回发请求。
谢谢
<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>