Fixed sorting in TableListField and subclasses

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@63524 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-10-02 08:53:44 +00:00
parent b9052753be
commit adee6b0e4a

View File

@ -242,7 +242,7 @@ JS
"Name" => $fieldName,
"Title" => $fieldTitle,
"IsSortable" => $isSortable,
"SortLink" => Convert::raw2xml($sortLink),
"SortLink" => $sortLink,
"SortBy" => $isSorted,
"SortDirection" => (isset($_REQUEST['ctf'][$this->Name()]['dir'])) ? $_REQUEST['ctf'][$this->Name()]['dir'] : null
));
@ -921,7 +921,14 @@ JS
}
function BaseLink() {
return $this->FormAction() . "&action_callfieldmethod&fieldName={$this->Name()}&ctf[ID]={$this->sourceID()}&methodName=ajax_refresh&SecurityID=" . Session::get('SecurityID');
$link = $this->FormAction() . "&action_callfieldmethod&fieldName={$this->Name()}&ctf[ID]={$this->sourceID()}&methodName=ajax_refresh&SecurityID=" . Session::get('SecurityID');
if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
$link = HTTP::setGetVar("ctf[{$this->Name()}][sort]", $_REQUEST['ctf'][$this->Name()]['sort']);
}
if(isset($_REQUEST['ctf'][$this->Name()]['dir'])) {
$link = HTTP::setGetVar("ctf[{$this->Name()}][dir]", $_REQUEST['ctf'][$this->Name()]['dir']);
}
return str_replace('&','&',$link);
}
/**