gpt4 book ai didi

javascript - Telerik过滤功能

转载 作者:行者123 更新时间:2023-12-02 14:41:10 25 4
gpt4 key购买 nike

我有一部分JavaScript可以在文档上运行。但是,当我使用 telerik 过滤时,成功过滤后,文档就绪的功能未注册。

 $(document).ready(function () {
// Match all link elements with href attributes within the content div
$('#image1').qtip({
content: {
text: true
},
style: {
classes: 'qtip-rounded qtip-shadow',
},
position: {
my: 'top center', // Position my top left...
at: 'bottom center', // at the bottom right of...
target: $('.selector') // my target
}
//position: {
// target: 'mouse',
//}
});
});

当我们单击 Telerik 提供的过滤的任何下拉值时,是否会调用 telerik 的任何函数。如果是这样,我可以从代码隐藏中注册 javascript 函数。或者,如果我可以通过任何其他方法得到认可。

最佳答案

如果您使用用于 ASP.NET 的 Telerik Ajax 控件,那么在过滤后发出回发(或异步回发)是正常行为。由于 Microsoft Ajax 的工作方式,Ajax 异步回发无法被 jQuery 的 Ready 函数拦截。

$(function(){
//this will only be triggered on the response to the first request
});

您应该使用 Microsoft Ajax 语法来拦截 Ajax 响应...

var mngInstance = Sys.WebForms.PageRequestManager.getInstance();

mngInstance.add_endRequest(endReq);
mngInstance.add_pageLoaded(pageLoaded);

function endReq(sender, args){
//executes after an async request ends
}

function pageLoaded(sender, args){
//executes after the whole page is loaded after an async postback
}

请注意,您将需要页面(或母版页)的 RadScriptManager。欲了解更多信息,请查看 MSDN documentation

关于javascript - Telerik过滤功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36995564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com