diff --git a/code/GridFieldEditableColumns.php b/code/GridFieldEditableColumns.php index 612508b..89992a1 100644 --- a/code/GridFieldEditableColumns.php +++ b/code/GridFieldEditableColumns.php @@ -138,7 +138,11 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements if(isset($info['callback'])) { $field = call_user_func($info['callback'], $record, $col, $grid); } elseif(isset($info['field'])) { - $field = new $info['field']($col); + if ($info['field'] == 'LiteralField') { + $field = new $info['field']($col, null); + }else{ + $field = new $info['field']($col); + } } if(!$field instanceof FormField) { diff --git a/composer.json b/composer.json index cc86f9c..b4dc72b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "ajshort/silverstripe-gridfieldextensions", + "name": "silverstripe-australia/gridfieldextensions", "description": "A collection of useful grid field components", "type": "silverstripe-module", "homepage": "http://github.com/ajshort/silverstripe-gridfieldextensions", @@ -9,7 +9,11 @@ { "name": "Andrew Short", "email": "andrewjshort@gmail.com" - } + }, + { + "name": "Marcus Nyeholt", + "email": "marcus@silverstripe.com.au" + } ], "support": { "issues": "http://github.com/ajshort/silverstripe-gridfieldextensions/issues" @@ -23,5 +27,8 @@ "docs/en/_images/editable-rows.png", "docs/en/_images/add-existing-search.png" ] + }, + "replace": { + "ajshort/silverstripe-gridfieldextensions": "self.version" } } diff --git a/css/GridFieldExtensions.css b/css/GridFieldExtensions.css index 5c6252c..0145e37 100644 --- a/css/GridFieldExtensions.css +++ b/css/GridFieldExtensions.css @@ -117,17 +117,29 @@ } .ss-gridfield-orderable .col-reorder { + position: relative; padding: 0 !important; width: 16px !important; } .ss-gridfield-orderable .col-reorder .handle { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; cursor: move; - display: none; } -.ss-gridfield-orderable tbody tr:hover .col-reorder .handle { - display: block; +.ss-gridfield-orderable .col-reorder .handle .icon { + position: absolute; + top: 50%; + left: 50%; + width: 5px; + height: 11px; + margin: -5px 0 0 -2px; + background-image: url('../../framework/thirdparty/jquery-ui-themes/smoothness/images/ui-icons_222222_256x240.png'); + background-position: -5px -227px; } .ss-gridfield-orderhelper { diff --git a/templates/GridFieldOrderableRowsDragHandle.ss b/templates/GridFieldOrderableRowsDragHandle.ss index 4899111..9702f53 100644 --- a/templates/GridFieldOrderableRowsDragHandle.ss +++ b/templates/GridFieldOrderableRowsDragHandle.ss @@ -1 +1 @@ - +