From ad919af544a5538c15a79b5a0f942f9ac510c15c Mon Sep 17 00:00:00 2001 From: colymba Date: Wed, 5 Sep 2012 21:36:05 +0300 Subject: [PATCH] Add select option --- code/GridFieldBulkManager.php | 5 +++++ javascript/GridFieldBulkManager.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/code/GridFieldBulkManager.php b/code/GridFieldBulkManager.php index 9984f34..b0ffdba 100644 --- a/code/GridFieldBulkManager.php +++ b/code/GridFieldBulkManager.php @@ -183,11 +183,16 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr GO '; + + $toggleSelectAllHTML = ' + Select all + '; $html = '
'. $dropDownActionList->FieldHolder(). //$actionButton->Field(). $actionButtonHTML. + $toggleSelectAllHTML. '
'; return array( diff --git a/javascript/GridFieldBulkManager.js b/javascript/GridFieldBulkManager.js index 40b59a0..72772ac 100644 --- a/javascript/GridFieldBulkManager.js +++ b/javascript/GridFieldBulkManager.js @@ -48,6 +48,17 @@ }*/ }); + $('#toggleSelectAll').entwine({ + onmatch: function(){ + }, + onunmatch: function(){ + }, + onclick: function(){ + var state = $(this).prop('checked'); + $('td.col-bulkSelect input').each(function(){ $(this).prop('checked', state); }); + } + }); + $('select#bulkActionName').entwine({ onmatch: function(){ },