Skip to content

Commit

Permalink
Persist new rows in between grid reloads. Closes symbiote#5.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshort committed Feb 12, 2013
1 parent 295681f commit 585b037
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions javascript/GridFieldExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 585b037

Please sign in to comment.