i using vue.js update content of array, should displayed in table. making async call server, need wait response update array should displayed. how table refreshed when data responders
array received?
<div class="tabel-responsive"> <div class="table table-hover"> <thead> <tr> <th>id</th> </tr> </thead> <tbody> <tr v-for="responder in responders"> <td>@{{ responder.userreference }}</td> </tr> </tbody> </div> </div>
vue.js
window.app = new vue({ el: '#giscontainer', data: { latitude: '', longitude: '', // responders responders: '', // gis mapcenterlocation: '', // store shared: store }, computed: { concatsearchaddress: function() { return this.street + ' ' + this.postalcode + ' ' + this.city; } }, methods: { // incident processing processincidentinformation: function() { // set gis map center new location this.setmapcentertosearchaddress(); // latitude , longitude of given location , search responders in range getlatlng(this.concatsearchaddress, function(latlng) { // setup latitude , longitude this.latitude = latlng[0].tofixed(6); this.longitude = latlng[1].tofixed(6); // search responders in range this.searchforrespondersinrange(); }.bind(this)); }, // gis setmapcentertosearchaddress: function() { // set location in map address given setmaplocationtoaddress(this.concatsearchaddress); }, // responders searchforrespondersinrange: function() { this.$http.get('v1/responders?'.concat("latitude=" + this.latitude + "&longitude=" + this.longitude)).then(function(response) { console.log(response); this.responders = response.data["data"]; }.bind(this)); }, getselectedresponder: function(responder) { this.selectedresponder = responder; this.getresponderdevices(responder); }, } });
Comments
Post a Comment