diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index ace1115e..bbb8c8e1 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -376,23 +376,6 @@ class ModelAdmin_CollectionController extends Controller { } return $output; } - - /** - * Action to render results for an autocomplete filter. - * - * @param unknown_type $request - * @return unknown - */ - function filter($request) { - $model = singleton($this->modelClass); - $context = $model->getDefaultSearchContext(); - $value = $request->getVar('q'); - $results = $context->getResults(array("Name"=>$value)); - header("Content-Type: text/plain"); - foreach($results as $result) { - echo $result->Name . "\n"; - } - } ///////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/javascript/ModelAdmin.js b/javascript/ModelAdmin.js index 7197d48d..adf2e040 100644 --- a/javascript/ModelAdmin.js +++ b/javascript/ModelAdmin.js @@ -19,27 +19,27 @@ jQuery(document).ready(function() { */ function showRecord(uri) { jQuery.get(uri, function(result){ - jQuery('#right').html(result); + jQuery('#right #ModelAdminPanel').html(result); jQuery('#SearchForm_holder').tabs(); // TODO/SAM: It seems a bit of a hack to have to list all the little updaters here. // Is livequery a solution? Behaviour.apply(); // refreshes ComplexTableField jQuery('#right ul.tabstrip').tabs(); - - jQuery('#Form_EditForm_action_goBack').click(function() { - if(__lastSearch) __lastSearch.trigger('submit'); - return false; - }); }); } + + jQuery('#Form_EditForm_action_goBack').livequery('click', function() { + if(__lastSearch) __lastSearch.trigger('submit'); + return false; + }); /** * POST a hash of form submitted data to the given endpoint */ function saveRecord(uri, data) { jQuery.post(uri, data, function(result){ - jQuery('#right').html(result); + jQuery('#right #ModelAdminPanel').html(result); // TODO/SAM: It seems a bit of a hack to have to list all the little updaters here. // Is livequery a solution? @@ -98,8 +98,8 @@ jQuery(document).ready(function() { form = jQuery(this); data = formData(form); jQuery.get(form.attr('action'), data, function(result){ - jQuery('#right').html(result); - jQuery('#right td').click(function(){ + jQuery('#right #ModelAdminPanel').html(result); + jQuery('#right #ModelAdminPanel td').click(function(){ td = jQuery(this); showRecord(td.parent().attr('title')); td.parent().parent().find('td').removeClass('active'); diff --git a/templates/Includes/ModelAdmin_right.ss b/templates/Includes/ModelAdmin_right.ss index 32e72de3..a1082f4d 100755 --- a/templates/Includes/ModelAdmin_right.ss +++ b/templates/Includes/ModelAdmin_right.ss @@ -1,4 +1,5 @@ -<% include Editor_toolbar %> + +
<% if EditForm %> $EditForm @@ -11,4 +12,6 @@ <% end_if %> +
+