Vuetable-2: loadingClass not used?

Created on 8 Apr 2017  路  8Comments  路  Source: ratiw/vuetable-2

Is loading class used for anything in the current build? It's in the docs, but I don't see it referenced anywhere in the code.

question

Most helpful comment

@chrislandeza The loadingClass is where you specify your CSS class to display the loader while the data is being loaded from the server. By default, it will work with Semantic UI. But if you're using Bootstrap, you can try following the instruction here. It was written for the first version of Vuetable but the technique still can be applied (I guess).

Vuetable fires a few events before and after the loading of data from the server.
vuetable:loading --> vuetable:load-success or vuetable:load-error --> vuetable:loaded

You can listen to those events to determine the state of the data requested from the server.

All 8 comments

If you're using Semantic-UI, the loading classs will show a loader by default. But if you're using other CSS Framework, you can use that to style your loader as you like.

@ratiw - how do you use the loadingClass? tried inspecting the element and no class is being appended on the <table>.

is there a vue property that I can access that determines if vuetable is currently fetching data from the server?

@chrislandeza The loadingClass is where you specify your CSS class to display the loader while the data is being loaded from the server. By default, it will work with Semantic UI. But if you're using Bootstrap, you can try following the instruction here. It was written for the first version of Vuetable but the technique still can be applied (I guess).

Vuetable fires a few events before and after the loading of data from the server.
vuetable:loading --> vuetable:load-success or vuetable:load-error --> vuetable:loaded

You can listen to those events to determine the state of the data requested from the server.

@ratiw I've got an issue trying to use Javascript Events here.
I can't get the events fired... I tried with _vuetable:loading_ and _vuetable:load-success_ but none of these worked.
Do you have any idea why ?

@bellissi1u Event object has been removed in Vue 2, so you can no longer use it. Can you explain on what do you want to do?

@ratiw Oh ok.
Actually, I changed my data table to yours, and I had a loading screen (just a div showing on a v-if and a boolean). So i'd like to show this div when the table is loading.

Basically, I just have to toggle a boolean true / false, but I can't get how.
Do you have any idea of how I could do that ?

@bellissi1u Basically, you've have to listen to vuetable:loading and vuetable:loaded events and called appropriate event handler to set/clear the flag to show the loading screen. See the code here

@ratiw Thanks it is exactly what I was looking for !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

legreco picture legreco  路  5Comments

kawamataryo picture kawamataryo  路  3Comments

ericksongmr picture ericksongmr  路  5Comments

flyingcoder picture flyingcoder  路  3Comments

jdriesen picture jdriesen  路  4Comments