Table Edits only does a couple things:
$("table tr").editable({
keyboard: true,
dblclick: true,
button: true,
buttonSelector: ".edit",
dropdowns: {},
maintainWidth: true,
edit: function(values) {},
save: function(values) {},
cancel: function(values) {}
});
The only additional markup Table Edits requires
is a data-field
attribute on each editable cell with it's column name.
Table Edits makes it easy to save edits. Callbacks are passed a values
object with column names and values of the edited row.
Posting the new data to an API endpoint is simple.
$("table tr").editable({
save: function(values) {
var id = $(this).data('id');
$.post('/api/object/' + id, values);
}
});
Project by @nathancahill. CSS boilerplate Skeleton by @dhg. Datepicker Pikaday by @dbushell.