2508 Posts in 675 Topics by 520 members
Data Model Questions
SilverStripe Forums » Data Model Questions » Sort ComplexTableField in the CMS
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1489 Views |
-
Sort ComplexTableField in the CMS

22 June 2009 at 2:41am Last edited: 22 June 2009 9:35am
Hi,
I've got a simple news section made with DataObjects. Everything works fine, I just want to sort the entries by date.
$newsTable = new ComplexTableField(
$this,
'NewsArticles',
'NewsArticle',
array(
'ArticleDate' => 'Article Date',
'ArticleTitle' => 'Article Title'
),
null
);Can anyone give me a hint? Thanks!
-
Re: Sort ComplexTableField in the CMS

22 June 2009 at 9:34am Last edited: 22 June 2009 9:34am
Ahhh, that's how it works:
$newsTable = new ComplexTableField(
$this,
'NewsArticles',
'NewsArticle',
array(
'ArticleDate' => 'Article Date',
'ArticleTitle' => 'Article Title'
),
null,
null,
'ArticleDate DESC'
);
| 1489 Views | ||
|
Page:
1
|
Go to Top |

