mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix sorting in complextablefield
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48250 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
27849e2418
commit
3a0fd261ad
@ -201,9 +201,14 @@ JS;
|
||||
$limitClause .= " OFFSET {$SQL_start}";
|
||||
}
|
||||
|
||||
$sourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $this->sourceSort, $this->sourceJoin, $limitClause);
|
||||
$sort = $this->sourceSort;
|
||||
if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
|
||||
$sort = Convert::raw2sql($_REQUEST['ctf'][$this->Name()]['sort']);
|
||||
}
|
||||
|
||||
$this->unpagedSourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $this->sourceSort, $this->sourceJoin);
|
||||
$sourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $sort, $this->sourceJoin, $limitClause);
|
||||
|
||||
$this->unpagedSourceItems = DataObject::get($this->sourceClass, $sort, $this->sourceSort, $this->sourceJoin);
|
||||
|
||||
$this->totalCount = ($this->unpagedSourceItems) ? $this->unpagedSourceItems->TotalItems() : null;
|
||||
|
||||
|
@ -12,6 +12,10 @@ TableListField.prototype = {
|
||||
onclick: this.deleteRecord.bind(this)
|
||||
};
|
||||
|
||||
rules['#'+this.id+' th a'] = {
|
||||
onclick: this.paginate.bind(this)
|
||||
};
|
||||
|
||||
rules['#'+this.id+' th'] = {
|
||||
initialize: function() {
|
||||
var sortLinks = $$('span.sortLinkHidden a', this);
|
||||
|
Loading…
Reference in New Issue
Block a user