Persist new rows in between grid reloads. Closes #5.

This commit is contained in:
ajshort 2013-02-12 20:21:43 +11:00
parent 295681f662
commit 585b03719f

View File

@ -76,6 +76,22 @@
* GridFieldAddNewInlineButton
*/
$(".ss-gridfield.ss-gridfield-editable").entwine({
reload: function(opts, success) {
var grid = this;
var added = grid.find(".ss-gridfield-inline-new").detach();
this._super(opts, function() {
if(added.length) {
added.appendTo(grid.find("tbody"));
grid.find(".ss-gridfield-no-items").hide();
}
if(success) success.apply(grid, arguments);
});
}
})
$(".ss-gridfield-add-new-inline").entwine({
onclick: function() {
var tmpl = window.tmpl;