VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs
Today, We want to share with you VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs.
In this post we will show you VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs, hear for VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs we will give you demo and example for implement.
In this post, we will learn about VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs with an example.
This Post covers the following topics Like as…
– Create a Table Row dynamically inside the table from inside form data using vuejs
– Add a Action Simple Delete button to the Deleted table Row using vuejs
– Simple Ability to Add the dynamically generated table Row using vuejs
in this Example will you show Creating dynamic table using Vue.js javscript Frameworks
Inclide Vuejs Libs
[php]
http://2.1.3/jquery.min.js
http://openexchangerates.github.io/accounting.js/accounting.min.js
http://Sortable/Sortable.js
http://vue/1.0.28/vue.min.js
http://js/index.js
[/php]
List Of VueJs dynamic table functionality
-One simple here vuetable tag
-VueJs dynamic table rows
-VueJs dynamic table columns
-add and delete rows dynamically using VueJs
-VueJs dynamic table header,VueJs dynamic table from json
-VueJs datatables dynamic columns
-VueJs json table
index.html
[php]
How to add new rows dynamically Vue.js
Creating Dynamic Tables with Vue.js
Sr No. | Product Description | Product Qty | Product Price | Product Tax | Total | Action |
---|---|---|---|---|---|---|
{{ $index +1 }} |
0% |
|
||||
TAX | {{ taxtotal | DisplayCustomCurr }} | |||||
TOTAL | {{ total | DisplayCustomCurr }} | |||||
GET-DELIVERY | ||||||
GRANDTOTAL | {{ grandtotal = total + getdelivery | DisplayCustomCurr }} |
{{ $data | json }}
[/php]
index.js
[php]
Vue.filter(‘DisplayCustomCurr’, {
read: function (val) {
if (val > 0) {
return accounting.formatMoney(val, “$”, 2, “.”, “,”);
}
},
write: function (val, oldVal) {
return accounting.unformat(val, “,”);
}
});
Vue.directive(‘sortable’, {
twoWay: true,
deep: true,
bind: function () {
var that = this;
var options = {
draggable: Object.keys(this.modifiers)[0]
};
this.sortable = Sortable.create(this.el, options);
this.sortable.option(“onUpdate”, function (e) {
that.value.splice(e.newIndex, 0, that.value.splice(e.oldIndex, 1)[0]);
});
this.onUpdate = function(value) {
that.value = value;
}
},
update: function (value) {
this.onUpdate(value);
}
});
var vm = new Vue({
el: ‘#app’,
data: {
products: [
{qty: 15, description: “Pakainfo.com”, price: 25.20, tax: 15},
{qty: 12, description: “live24u else”, price: 33.20, tax: 20},
],
total: 0,
grandtotal: 0,
taxtotal: 0,
getdelivery: 41
},
computed: {
total: function () {
var t = 0;
$.each(this.products, function (i, e) {
t += accounting.unformat(e.total, “,”);
});
return t;
},
taxtotal: function () {
var tt = 0;
$.each(this.products, function (i, e) {
tt += accounting.unformat(e.tax_amount, “,”);
});
return tt;
}
},
methods: {
addlived: function (index) {
try {
this.products.splice(index + 1, 0, {});
} catch(e)
{
console.log(e);
}
},
removelived: function (index) {
this.products.splice(index, 1);
},
getData: function () {
$.ajax({
context: this,
type: “POST”,
data: {
products: this.products,
total: this.total,
getdelivery: this.getdelivery,
taxtotal: this.taxtotal,
grandtotal: this.grandtotal,
},
url: “/api/data”
});
}
}
});
[/php]
We hope you get an idea about VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please donβt forget to share this as Well as Like FaceBook Page.
We hope This Post can help you…….Good Luck!.