silverstripe / silverstripe-lumberjack

Keep in control of large SiteTrees by using GridField to manage pages.
BSD 2-Clause "Simplified" License
33 stars 35 forks source link

Adding `GridFieldOrderableRows` works but can't move items between pages #101

Open sinan-evanshunt opened 3 years ago

sinan-evanshunt commented 3 years ago

To be fair, not sure if this is a lumberjack issue or gridfield or COVID. But here is what I have done to allow lumberjack gridfield items be sortable:

use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;

public function getLumberjackGridFieldConfig() {
        $lumberjackGridfieldConfig = GridFieldConfig_Lumberjack::create();
        $lumberjackGridfieldConfig->addComponent(new GridFieldOrderableRows('Sort'));
        return $lumberjackGridfieldConfig;
    }

Now that worked great, I can manually sort the items by dragging and dropping them. But if I wanted to move one item from one page to another by dragging it to the pagination arrows, I get this JS console error:

image

` Uncaught TypeError: this.helper is null vendor.js:1:2037761 _clear http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 ./thirdparty/jquery-ui/jquery-ui.js/</</e.widget/</r[t]</< http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 _mouseStop http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 ./thirdparty/jquery-ui/jquery-ui.js/</</e.widget/</r[t]</< http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 _mouseUp http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 ./thirdparty/jquery-ui/jquery-ui.js/</</e.widget/</r[t]</< http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 _mouseUpDelegate http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 dispatch http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:2726 eventHandle http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:2384 add http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:2421 on http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:3135 each http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:487 each http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:170 on http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:3134 name http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438 line 1 > eval:3232 js http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 js http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 js http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 t http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 js http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 t http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1

http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 ​` Any insight or how could I fix this would be greatly appreciated.
michalkleiner commented 3 years ago

It's a known gridfield issue. The best workaround we use, so far, is providing configurable paginator with a config where the items can happen to be on the same page.

sinan-evanshunt commented 3 years ago

Yeah, I had this idea too if it was not possible to fix it easily. Thanks for the comment.

gdelavil commented 7 months ago

Hi all. I just wanted to check if there's been any changes related to this issue, or if the best approach is still to provide custom pagination? Just having to solve this on a project at the moment. Thanks!