DataTable using a different data sources

  • Hi …

    I was very happy to see that Quasar got a DataTable , as this is a extremely useful component, but I like to use other sources that plain data in an array, an like to ask if it would be possible to make some kind of data store.

    This way we could support the current data array model, but also make things like paged RESTful called to deferment backends, but isolate data providing and rendering.

    Something like :

    class DataStore {
        query( args: Object, order: Array, limit:number, offset: number ) : es6_iterator
        getKeyName(): string
        remove( key )
        set( key, data ) 
        get( key ) : any

    This model would of cause have a memory version that could be used by default, to make it simple to make simple things.

    I could also try to do this as a PR (if I can find a way to make it work), is this has any interest :-)

  • Admin

    @bl Hi. Due to Vue we have computed properties so you can retrieve data in any format you want then use a computed property to feed to DataTable component. This way data can come in any form or shape, as long you compute it to an array. Does this help you?

  • Thanks, this make sense as long as the data list is somewhat small ( < 100), but if you have lists that is very large (10K) and like to range load data (to keep memory load on both the client and the backend down) and therefor need to make the provider (database) do the sorting and filtering we need to do something else.

    That is why it could be nice with a data store interface, like the one suggested as we could model any data provider using something like this.

    Inspired by things like dstore.

  • Admin

    @druppy Yes you got a good point here. Will see about this.

Log in to reply

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.