From 04c49653a6569b0c34ca5737178e9a8978e2ccf7 Mon Sep 17 00:00:00 2001 From: Shea Date: Mon, 10 Sep 2012 13:38:00 +1000 Subject: [PATCH] BUGFIX renamed the Items array that is sent in post, as it was being overriden by another postvar called Items, containing GridState data. The array of Item Ids used by SortableGridField is now called ItemIDs --- code/forms/GridFieldSortableRows.php | 8 ++++---- javascript/GridFieldSortableRows.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index 2260738..cb482f1 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -230,15 +230,15 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP //@TODO Need to optimize this to eliminate some of the resource load could use raw queries to be more efficient - $data['Items'] = explode(',', $data['Items']); - for($sort = 0;$sortbyID($ids[$sort]); $obj->$sortColumn = ($sort + 1) + $pageOffset; $obj->write(); } diff --git a/javascript/GridFieldSortableRows.js b/javascript/GridFieldSortableRows.js index 615a3dd..5759abe 100644 --- a/javascript/GridFieldSortableRows.js +++ b/javascript/GridFieldSortableRows.js @@ -41,7 +41,7 @@ value: button.val() }, { - name: 'Items', + name: 'ItemIDs', value: dataRows } ]});