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

    q-table shows not data

    Framework
    3
    20
    3210
    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.
    • C
      chyde90 @PrasadChinwal last edited by

      @PrasadChinwal So the QTable definitely has got the data, and there is no error in the console. Now, the only thing that could go wrong is that there is some kind of reactivity issue.
      I have an idea: For testing purposes, please put the following in your response callback:

      setTimeout(() => this.results = this.results.concat([]), 3000);
      

      This is not a solution - but if you now (after 3 seconds) see the data, we have a clue where to search in order to actually fix the problem.

      P 1 Reply Last reply Reply Quote 0
      • P
        PrasadChinwal @chyde90 last edited by

        @chyde90 I dont see the data in vue devtools for QTable. Do we have a clue on how to proceed? I really appreciate your help.

        C 1 Reply Last reply Reply Quote 0
        • C
          chyde90 @PrasadChinwal last edited by

          @PrasadChinwal You don’t? But in the post before you said you do (and it’s in the screenshot). Or do you mean after you included the setTimeout thing? I’m confused

          P 1 Reply Last reply Reply Quote 0
          • P
            PrasadChinwal @chyde90 last edited by

            @chyde90 My Bad. I do not see any data after adding the setTimeout();

            C 1 Reply Last reply Reply Quote 0
            • C
              chyde90 @PrasadChinwal last edited by

              @PrasadChinwal uhhhm… really??^^
              Just to make sure - you wrote it like this:

              getReportByDate() {
              	...
              	axios.get( ... ).then((response) => {
              		this.loading = false;
              		this.results = (response.data);
              		console.log(this.results);
              		setTimeout(() => this.results = this.results.concat([]), 3000); // <--- this line added
              	}).catch(error => {
              		console.log(error);
              	});
              },
              

              Right?
              I expect either no changes at all, or that the table suddenly renders what you want to see.
              Because this effectively does not do anyhing except triggering an update.

              P 2 Replies Last reply Reply Quote 0
              • P
                PrasadChinwal @chyde90 last edited by

                @chyde90 Oh I see what you mean. I tried concatenating the response again in the timeout.

                Unfortunately even with the above approach, as you mentioned there is no change at all. The data is present in devtools QTable but not displayed.

                1 Reply Last reply Reply Quote 0
                • P
                  PrasadChinwal @chyde90 last edited by PrasadChinwal

                  @chyde90 Gist to File

                  1 Reply Last reply Reply Quote 0
                  • C
                    chyde90 last edited by

                    HAH! I think I found it! 😃
                    You initialize pagination with page 2. Initialize it with 1 - does it work now?

                    1 Reply Last reply Reply Quote 0
                    • P
                      PrasadChinwal last edited by

                      Oh dear lord ! Yes. I do see the data. I feel so stupid.
                      Anyways, Thanks a lot for helping out and I apologize for hogging your time.

                      1 Reply Last reply Reply Quote 0
                      • C
                        chyde90 last edited by chyde90

                        Yayyyy :DD Hey no problem… it was fun^^
                        No need to feel stupid there. It wasn’t really obvious because the pagination wasn’t visible.

                        Here is a tip / how I solve this kind of problem:
                        Remove everything from the code that is not needed to replicate the problem, feature by feature. And everytime test if you can reproduce the problem.
                        So when the problem doesn’t occur anymore, you know which part caused it. And if not, then you at least have a simpler and shorter version where you can spot it more easily

                        P 1 Reply Last reply Reply Quote 0
                        • P
                          PrasadChinwal @chyde90 last edited by

                          @chyde90 That’s a really great advise. I really am thankful. I will try and use this trick whenever applicable. Have a great day ahead!

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