No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Solved] Endless scroll bug?

    Help
    2
    3
    1147
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mesqueeb
      mesqueeb last edited by mesqueeb

      Even though I correctly run done() it keeps on loading endlessly!

      	loadMore(index, done) {
      		// index - called for nth time
      		// done - Function to call when you made all necessary updates.
      		//        DO NOT forget to call it otherwise your loading message
      		//        will continue to be displayed
      		// make some Ajax call then call done()
      		store.dispatch('fetchDone').then(fetched => {
      			console.log(fetched);
      			if (fetched == 'fetchedAll'){
      				done();
      			}
      		})
      

      Also, I wonder what the difference between done() and stop() is. The docs are unclear in that.

      1 Reply Last reply Reply Quote 0
      • E
        Epo last edited by

        Try done(true). This schould stop endless loading

        1 Reply Last reply Reply Quote 0
        • mesqueeb
          mesqueeb last edited by mesqueeb

          I got this from chatting on Gitter, in case anyone wants to know:

          The stop() method is used to interrupt loading no matter the scroll position. The done() method should always be called after each ajax request, else the loading message stays
          → on all callbacks?
          Yes. It used to define not your fetch is done but to define your REQUEST is done. Always call done() at the end of the handler.
          So in your case:

          store.dispatch('fetchDone').then(_ => done());
          

          → I don’t need to indicate there’s no more data on the server left to fetch?

          just save something like true to window.noMoreData if all data is fetched. And if (window.noMoreData){ return } in front of the ajax call in the loadMore method.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post