Vuejs Inline Editing Table – vuejs grid – vue datatable – vue smart table

Vuejs Inline Editing Table – vuejs grid – vue datatable – vue smart table

Welcome on infinityknow.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Vuejs Inline Editing Table – vuejs grid – vue datatable – vue smart table

In this post we will show you Best way to implement Inline Editing HTML table with Vuejs Ajax and PHP, hear for How to inline Edit Remove using Ajax/Vuejs in PHP MySql with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

READ :  Vuejs DataTables responsive Example

Include External Links : libs

[php]
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
https://rubaxa.github.io/Sortable/Sortable.js
https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.28/vue.min.js
[/php]

index.html – Markup HTML Part

[php]

Stud No. comments std fees exloan fulltotal
{{ $index +1 }}

0%
11%
22%


exloan {{ exloanfulltotal | DisplayCurrentCurrency }}
fulltotal {{ fulltotal | DisplayCurrentCurrency }}
datareturn
Finalfulltotal {{ Finalfulltotal = fulltotal + datareturn | DisplayCurrentCurrency }}

{{ $data | json }}

[/php]

index.js – Script File

[php]

Vue.filter(‘DisplayCurrentCurrency’, {
// model -> view
read: function (param) {
if (param > 0) {
return accounting.formatMoney(param, “$”, 2, “.”, “,”);
}
},
// view -> model
write: function (param, oldparam) {
return accounting.unformat(param, “,”);
}
});

Vue.directive(‘sortable’, {
twoWay: true,
deep: true,
bind: function () {
var that = this;

READ :  vuejs Table Searching Sorting and Pagination

var options = {
draggable: Object.keys(this.modifiers)[0]
};

this.sortable = Sortable.create(this.el, options);
console.log(‘sortable bound!’)

this.sortable.option(“onUpdate”, function (e) {
that.paramue.splice(e.newIndex, 0, that.paramue.splice(e.oldIndex, 1)[0]);
});

this.onUpdate = function(paramue) {
that.paramue = paramue;
}
},
update: function (paramue) {
this.onUpdate(paramue);
}
});

var vm = new Vue({
el: ‘#liveapp’,
data: {
table_rows: [
//initial simple data
{std: 5, comments: “Something”, fees: 55.20, exloan: 10},
{std: 2, comments: “Something else”, fees: 1255.20, exloan: 20},
],
fulltotal: 0,
Finalfulltotal: 0,
exloanfulltotal: 0,
datareturn: 40
},
computed: {
fulltotal: function () {
var t = 0;
$.each(this.table_rows, function (i, e) {
t += accounting.unformat(e.fulltotal, “,”);
});
return t;
},
exloanfulltotal: function () {
var tt = 0;
$.each(this.table_rows, function (i, e) {
tt += accounting.unformat(e.exloan_amount, “,”);
});
return tt;
}
},
methods: {
createRow: function (index) {
try {
this.table_rows.splice(index + 1, 0, {});
} catch(e)
{
console.log(e);
}
},
deleteRow: function (index) {
this.table_rows.splice(index, 1);
},
liveGetData: function () {
$.ajax({
context: this,
type: “POST”,
data: {
table_rows: this.table_rows,
fulltotal: this.fulltotal,
datareturn: this.datareturn,
exloanfulltotal: this.exloanfulltotal,
Finalfulltotal: this.Finalfulltotal,
},
url: “/api/data”
});
}
}
});
[/php]

READ :  VueJS Features and Benefits - Vuejs advantages and disadvantages

Example

I hope you have Got Inline Editing HTML table with Vuejs Ajax and PHP And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Leave a Comment