Giter VIP home page Giter VIP logo

Comments (3)

matfish2 avatar matfish2 commented on August 28, 2024 1

You need to bind this, so it will refer to your Vue instance:

this.$http.jsonp('http://localhost:8080/').then(function(res){
              this.listeCnts=JSON.stringify(res.data)
          }.bind(this)); 

Also, JSON.stringify converts your data to a string. You need to pass an array.

from vue-tables.

matfish2 avatar matfish2 commented on August 28, 2024

Updating one variable doesn't affect another. You should assign itemCategories directly to v-client-table, and skip the tableData middleman altogether.

from vue-tables.

Laurent-ALLO avatar Laurent-ALLO commented on August 28, 2024

I have a similar problem.
<v-client-table :data="listeCnts" :columns="columns" :options="options"> </v-client-table>

In my app, i use a REST API for change the data of listeCnts:

Vue.use(VueTables.client, {filterByColumn: true});

new Vue({
  el: "#app",
  data: {
    listeCnts: [ 
      { id:1, numcnt : '5748', reg:'NE' },
      { id:2, numcnt : '4875', reg:'OU' },
    ],
    columns:['id','numcnt','reg'],
    options: {},
   },
   methods: {
      recup: function () {
          this.$http.jsonp('http://localhost:8080/').then(function(res){
              this.listeCnts=JSON.stringify(res.data)
          }); 
      }
  }
});

If i print listeCnts values after the call of recup function. I can see the values of listCnts had change but not my table.

from vue-tables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.