mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Avoid manually constructing URLs.
This means that URLs with query parameters are no longer incorrectly created. Closes #6, #23, #27.
This commit is contained in:
parent
712c5070e9
commit
82bb0524b3
@ -86,9 +86,15 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param GridField $field
|
||||||
|
*/
|
||||||
public function getHTMLFragments($field) {
|
public function getHTMLFragments($field) {
|
||||||
GridFieldExtensions::include_requirements();
|
GridFieldExtensions::include_requirements();
|
||||||
|
|
||||||
$field->addExtraClass('ss-gridfield-orderable');
|
$field->addExtraClass('ss-gridfield-orderable');
|
||||||
|
$field->setAttribute('data-url-reorder', $field->Link('reorder'));
|
||||||
|
$field->setAttribute('data-url-movetopage', $field->Link('movetopage'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function augmentColumns($grid, &$cols) {
|
public function augmentColumns($grid, &$cols) {
|
||||||
|
@ -192,7 +192,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
grid.reload({
|
grid.reload({
|
||||||
url: grid.data("url") + "/reorder",
|
url: grid.data("url-reorder"),
|
||||||
data: data.get()
|
data: data.get()
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -228,7 +228,7 @@
|
|||||||
|
|
||||||
grid.find("tbody").sortable("cancel");
|
grid.find("tbody").sortable("cancel");
|
||||||
grid.reload({
|
grid.reload({
|
||||||
url: grid.data("url") + "/movetopage",
|
url: grid.data("url-movetopage"),
|
||||||
data: [
|
data: [
|
||||||
{ name: "move[id]", value: ui.draggable.data("id") },
|
{ name: "move[id]", value: ui.draggable.data("id") },
|
||||||
{ name: "move[page]", value: page }
|
{ name: "move[page]", value: page }
|
||||||
|
Loading…
Reference in New Issue
Block a user