mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Making full result table rows in ModelAdmin selectable
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92773 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c9646d8d43
commit
2683a5ae62
@ -606,6 +606,7 @@ class ModelAdmin_CollectionController extends Controller {
|
|||||||
$resultsForm = $this->ResultsForm(array_merge($form->getData(), $request));
|
$resultsForm = $this->ResultsForm(array_merge($form->getData(), $request));
|
||||||
// Before rendering, let's get the total number of results returned
|
// Before rendering, let's get the total number of results returned
|
||||||
$tableField = $resultsForm->Fields()->dataFieldByName($this->modelClass);
|
$tableField = $resultsForm->Fields()->dataFieldByName($this->modelClass);
|
||||||
|
$tableField->addExtraClass('resultsTable');
|
||||||
$numResults = $tableField->TotalCount();
|
$numResults = $tableField->TotalCount();
|
||||||
|
|
||||||
if($numResults) {
|
if($numResults) {
|
||||||
|
@ -61,8 +61,8 @@ body.ModelAdmin #SearchForm_holder form div#ResultAssembly{
|
|||||||
width: 45%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.ModelAdmin #ResultTable_holder {
|
body.ModelAdmin .resultsTable tbody td {
|
||||||
overflow:auto;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.ModelAdmin #right{
|
body.ModelAdmin #right{
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
*/
|
*/
|
||||||
$('#ModelClassSelector select').concrete({
|
$('#ModelClassSelector select').concrete({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
|
var self = this;
|
||||||
// Set up an onchange function to show the applicable form and hide all others
|
// Set up an onchange function to show the applicable form and hide all others
|
||||||
this.bind('change', function(e) {
|
this.bind('change', function(e) {
|
||||||
var $selector = $(this);
|
self.find('option').each(function() {
|
||||||
this.find('option').each(function() {
|
|
||||||
var $form = $('#'+$(this).val());
|
var $form = $('#'+$(this).val());
|
||||||
if($selector.val() == $(this).val()) $form.show();
|
if(self.val() == $(this).val()) $form.show();
|
||||||
else $form.hide();
|
else $form.hide();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -96,13 +96,13 @@
|
|||||||
/**
|
/**
|
||||||
* Table record handler for search result record
|
* Table record handler for search result record
|
||||||
*/
|
*/
|
||||||
$('form[name=Form_ResultsForm] tbody td a').concrete({
|
$('.resultsTable tbody td').concrete({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
// TODO Replace with concrete event handler
|
// TODO Replace with concrete event handler
|
||||||
this.bind('click', function(e) {
|
this.bind('click', function(e) {
|
||||||
if($(this).hasClass('deletelink downloadlink')) return true;
|
var firstLink = $(this).find('a[href]');
|
||||||
|
if(!firstLink) return;
|
||||||
$('#Form_EditForm').concrete('ss').loadForm($(this).attr('href'));
|
$('#Form_EditForm').concrete('ss').loadForm(firstLink.attr('href'));
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user