-
Notifications
You must be signed in to change notification settings - Fork 62
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
[REQUEST] Event to indicate that there has been a change in sort order. #39
Comments
Hmm, I'll see what I can do. It may need to happen on the data object because the current controller may not be say the page's controller. Would that work? Though then it would be just notifying that object that it's sort is changing or has changed. That said I'll see what I can do. |
In the case of an inherited dataset controlled for ModelAdmin $controller = Controller::curr() returns the object of class inherited from ModelAdmin, so I think it could work in all normal cases. Regards, |
Ya in the case of a page it would be CMSMain or a subclass of that. Which won't be useful there but, for a sub-class of ModelAdmin I could definitely see it being useful in some cases. I'll look at adding it. |
Any progress in this regard? Thanks, |
No sorry, been flat out at work so I haven't felt much like doing more programming in the evening. I'll try to get it tonight or tomorrow though. Should be a really simple addition. |
Thanks Ed, |
I'm thinking it may just make more sense for these events if I passed the datalist instance back, because then you'd have full access to the list as it appears to GridFieldSortableRows and since DataList's are more or less just sql queries unlike the old DataObjectSet you'd be able to iterate the list. It would defiantly make it easier for many many lists that's for sure. Think that would work for you? |
Perfect, I need exactly the records where there has been a change in the display order. Thanks Ed, |
Great, works perfectly. Regards, |
Hi!
To make some operations I need to detect that the user has changed the lines order.
The event should indicate the ID's and classname in which changes have occurred.
The event could be defined in the current controller.
$controller = Controller::curr();
&controller->onBeforeChangeSort(...)
Thank you for this wonderful module.
Jose A.
The text was updated successfully, but these errors were encountered: