mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
Persist new rows in between grid reloads. Closes #5.
This commit is contained in:
parent
295681f662
commit
585b03719f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user