stevenrskelton / sortable-table

Polymer Web Component that generates a sortable <table> from inlined or AJAX JSON, JSON5, and arrays.
https://stevenrskelton.github.io/sortable-table/
MIT License
196 stars 37 forks source link

Server side saving of edited rows #25

Open jorgdec opened 9 years ago

jorgdec commented 9 years ago

Any plans the implement server side saving of edited rows? We needed this for our project using php and polymer. We implemented this by adding, in our case, the following lines to extjs-ajax.html :

var tableToJson = (this.data ? JSON.stringify(this.data) : "'');
var params = { _dc: (new Date).getTime(), page: 0, start: this.start, table: tableToJson }; this.ajax.method = 'POST';

and adding a function to sortable-table.html to trigger on a button click : saveTable: function(){ this.dataSource.go(); },

This way we can save the edited table in php without losing pagination, sorting, etc...