Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sinan-evanshunt opened this issue Dec 3, 2020 · 3 comments

Comments

@sinan-evanshunt
Copy link

sinan-evanshunt commented Dec 3, 2020

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 <anonymous> http://localhost/resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1591934438:1 <anonymous> 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
Copy link

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
Copy link
Author

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

@gdelavil
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants