Is there an easy way to disable the spinner when loading more content in the list view on endless scroll mode? I can set the following CSS to hide it altogether but this would affect the initial load and load after filter etc
.k-loading-mask { display: none !important; }
Many thanks,
Dale
1 Answer, 1 is accepted
0
Accepted
Stoyan
Telerik team
answered on 12 Dec 2023, 04:30 PM
Hello Dale,
Achieving this requirement for a specific behavior like subsequent fetches of data from the server is indeed tricky.
You can subscribe to the DataSource's RequestStart Event to most accurately catch the time at which the loader appears and set it visibility to hidden.
var requestStart = 0;
function onRequestStart(e){
requestStart++;
if(requestStart==1){
setTimeout(function(){
$(".k-loading-mask").css("visibility","visible");
})
}else{
setTimeout(function(){
$(".k-loading-mask").css("visibility","hidden");
})
}
}
.k-loading-mask{
visibility:hidden;
}
I have applied the code above to this Telerik REPL example. Please give it a try and let me know how it works on your side.
Regards,
Stoyan
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portalpages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
I am having trouble getting this working with my code. It uses an odd mix of taghelper and html helper, I get a console error that the function is not defined? (note I added the on-request-start tag)
Edit: nevermind, it was simply because the script was after instead of before the html