mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Move BulkManager commands to header
BulkManager has it's own header and template
This commit is contained in:
parent
6110d81c94
commit
5b79b94496
@ -171,33 +171,23 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
|
||||
|
||||
$dropDownActionList = DropdownField::create('bulkActionName', '')
|
||||
->setSource( array('edit' => 'Edit','unlink' => 'UnLink','delete' => 'Delete') );
|
||||
/*
|
||||
$actionButton = FormAction::create('doBulkAction', 'GO')
|
||||
->setAttribute('id', 'doBulkActionButton')
|
||||
//->addExtraClass('cms-panel-link')
|
||||
->setAttribute('data-icon', 'pencil')
|
||||
->setAttribute('data-url', $gridField->Link('bulkEdit'))
|
||||
->setAttribute('href', $gridField->Link('bulkEdit').'/edit')
|
||||
->setUseButtonTag(true);
|
||||
*/
|
||||
$actionButtonHTML = '
|
||||
<a id="doBulkActionButton" href="'.$gridField->Link('bulkediting').'/edit'.'" data-url="'.$gridField->Link('bulkediting').'" class="action ss-ui-button cms-panel-link" data-icon="pencil">
|
||||
GO
|
||||
</a>';
|
||||
|
||||
$toggleSelectAllHTML = '
|
||||
<span>Select all <input id="toggleSelectAll" type="checkbox" title="select all" name="toggleSelectAll" /></span>
|
||||
';
|
||||
$templateData = new ArrayData(array(
|
||||
'Menu' => $dropDownActionList->FieldHolder(),
|
||||
'Button' => array(
|
||||
'Label' => 'Go',
|
||||
'Link' => $gridField->Link('bulkediting').'/edit',
|
||||
'DataURL' => $gridField->Link('bulkediting')
|
||||
),
|
||||
'Select' => array(
|
||||
'Label' => 'Select all'
|
||||
)
|
||||
));
|
||||
|
||||
$html = '<div id="bulkManagerOptions">'.
|
||||
$dropDownActionList->FieldHolder().
|
||||
//$actionButton->Field().
|
||||
$actionButtonHTML.
|
||||
$toggleSelectAllHTML.
|
||||
'</div>';
|
||||
$args = array('Colspan' => count($gridField->getColumns())-1);
|
||||
|
||||
return array(
|
||||
'bulk-edit-tools' => $html
|
||||
'header' => $templateData->renderWith('BulkManagerButtons', $args)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,13 @@
|
||||
|
||||
#bulkManagerOptions
|
||||
{
|
||||
float: right;
|
||||
margin: 0 0 0 20px;
|
||||
/*float: right;
|
||||
margin: 0 0 0 20px;*/
|
||||
}
|
||||
|
||||
#bulkManagerOptions th.bulkmanagerselect
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#bulkActionName
|
||||
@ -19,6 +24,11 @@
|
||||
display: inline-block;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#bulkActionName #bulkActionName_chzn
|
||||
@ -26,6 +36,11 @@
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
#bulkActionName .chzn-drop
|
||||
{
|
||||
width: 95% !important;
|
||||
}
|
||||
|
||||
.cms table.ss-gridfield-table tbody td a.tempDisabledEditLink
|
||||
{
|
||||
background: url('../../framework/admin/images/btn-icon/document--pencil.png') no-repeat 2px 0px;
|
||||
|
14
templates/BulkManagerButtons.ss
Normal file
14
templates/BulkManagerButtons.ss
Normal file
@ -0,0 +1,14 @@
|
||||
<tr id="bulkManagerOptions">
|
||||
<th class="extra bulkmanagerheading" colspan="$Colspan">
|
||||
|
||||
$Menu
|
||||
<a id="doBulkActionButton" href="$Button.Link" data-url="$Button.DataURL" class="action ss-ui-button cms-panel-link" data-icon="pencil">
|
||||
$Button.Label
|
||||
</a>
|
||||
|
||||
|
||||
</th>
|
||||
<th class="extra bulkmanagerselect">
|
||||
<input id="toggleSelectAll" type="checkbox" title="$Select.Label" name="toggleSelectAll" />
|
||||
</th>
|
||||
</tr>
|
Loading…
Reference in New Issue
Block a user