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

    'Async' Initialise Columns and table in data-table component?

    Help
    2
    3
    1957
    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.
    • J
      johnorford last edited by

      New the both Vue and Quasar, so perhaps this is easy.

      I have a table which sets ‘table’ and ‘columns’ asynchronously as the view is ‘created’, and refreshes every couple of seconds.

      The problem is, before all this, I need to initialise ‘this.columns’ and ‘this.table’ in a synchronous manner, otherwise I see errors.

      I do this with dummy data, but it seems redundant.

      Any ideas? maybe I should just be happy with what I have (i.e. everything works, just not as nice as possible).

      1 Reply Last reply Reply Quote 0
      • J
        johnorford last edited by

        It looks like only ‘columns’ needs to be set on initialisation, rather than ‘table’, which is nicer

        1 Reply Last reply Reply Quote 0
        • s.molinari
          s.molinari last edited by

          Yes, Vue requires the data object properties (in the data() function) to be available prior to rendering, so it knows what needs to be reactive. This explains why better.

          https://vuejs.org/v2/guide/reactivity.html

          This, for instance, allows for the dynamic alteration of the columns in the example data table. http://quasar-framework.org/components/data-table.html

          Scott

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