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
@ -200,10 +200,15 @@ JS;
|
||||
$SQL_start = intval($_REQUEST['ctf'][$this->Name()]['start']);
|
||||
$limitClause .= " OFFSET {$SQL_start}";
|
||||
}
|
||||
|
||||
$sort = $this->sourceSort;
|
||||
if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
|
||||
$sort = Convert::raw2sql($_REQUEST['ctf'][$this->Name()]['sort']);
|
||||
}
|
||||
|
||||
$sourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $this->sourceSort, $this->sourceJoin, $limitClause);
|
||||
$sourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $sort, $this->sourceJoin, $limitClause);
|
||||
|
||||
$this->unpagedSourceItems = DataObject::get($this->sourceClass, $this->sourceFilter, $this->sourceSort, $this->sourceJoin);
|
||||
$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);
|
||||
@ -269,4 +273,4 @@ TableListRecord.prototype = {
|
||||
}
|
||||
|
||||
//TableListRecord.applyTo('div.TableListField tr');
|
||||
TableListField.applyTo('div.TableListField');
|
||||
TableListField.applyTo('div.TableListField');
|
||||
|
Loading…
Reference in New Issue
Block a user