(merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@60228 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-08-09 06:18:32 +00:00
parent 689c34400b
commit 649ff87aec
3 changed files with 13 additions and 27 deletions

View File

@ -377,23 +377,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";
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/**

View File

@ -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() {
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');

View File

@ -1,4 +1,5 @@
<% include Editor_toolbar %>
<div id="ModelAdminPanel">
<% if EditForm %>
$EditForm
@ -11,4 +12,6 @@
</form>
<% end_if %>
</div>
<p id="statusMessage" style="visibility:hidden"></p>