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:
Ingo Schommer 2009-11-21 03:17:49 +00:00
parent c9646d8d43
commit 2683a5ae62
3 changed files with 10 additions and 9 deletions

View File

@ -606,6 +606,7 @@ class ModelAdmin_CollectionController extends Controller {
$resultsForm = $this->ResultsForm(array_merge($form->getData(), $request));
// Before rendering, let's get the total number of results returned
$tableField = $resultsForm->Fields()->dataFieldByName($this->modelClass);
$tableField->addExtraClass('resultsTable');
$numResults = $tableField->TotalCount();
if($numResults) {

View File

@ -61,8 +61,8 @@ body.ModelAdmin #SearchForm_holder form div#ResultAssembly{
width: 45%;
}
body.ModelAdmin #ResultTable_holder {
overflow:auto;
body.ModelAdmin .resultsTable tbody td {
cursor: pointer;
}
body.ModelAdmin #right{

View File

@ -19,12 +19,12 @@
*/
$('#ModelClassSelector select').concrete({
onmatch: function() {
var self = this;
// Set up an onchange function to show the applicable form and hide all others
this.bind('change', function(e) {
var $selector = $(this);
this.find('option').each(function() {
self.find('option').each(function() {
var $form = $('#'+$(this).val());
if($selector.val() == $(this).val()) $form.show();
if(self.val() == $(this).val()) $form.show();
else $form.hide();
});
});
@ -96,13 +96,13 @@
/**
* Table record handler for search result record
*/
$('form[name=Form_ResultsForm] tbody td a').concrete({
$('.resultsTable tbody td').concrete({
onmatch: function() {
// TODO Replace with concrete event handler
this.bind('click', function(e) {
if($(this).hasClass('deletelink downloadlink')) return true;
$('#Form_EditForm').concrete('ss').loadForm($(this).attr('href'));
var firstLink = $(this).find('a[href]');
if(!firstLink) return;
$('#Form_EditForm').concrete('ss').loadForm(firstLink.attr('href'));
return false;
});
}