q-table shows not data
-
@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.
-
@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
-
@chyde90 My Bad. I do not see any data after adding the setTimeout();
-
@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. -
@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.
-
-
HAH! I think I found it!
You initialize pagination with page2
. Initialize it with1
- does it work now? -
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. -
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 -
@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!