7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 54218 Views |
-
Re: Preview: DataObjectManager module

31 March 2009 at 8:15am
Thanks. I've already started making the update. Only thing I did differently was put the if clause within the <div class="pad">
-
Re: Preview: DataObjectManager module

31 March 2009 at 8:26am Last edited: 31 March 2009 8:28am
How about ...?
public function setColumnWidths($widths) {
...
die('<strong>DataObjectManager::setColumnWidths()</strong>:' . _t('DataObjectManager.TOTALNOT100','Column widths must total 100 and not '.$total));
...
}I don't like counting...
-
Re: Preview: DataObjectManager module

31 March 2009 at 8:31am
Yeah, I had that originally, but I don't think it gets along with the _t() function when you have a variable in the translated string.
-
Re: Preview: DataObjectManager module

31 March 2009 at 8:39am
That's right...
sprintf(_t('DataObjectManager.TOTALNOT100','Column widths must total 100 and not %s'), $total)
-
Re: Preview: DataObjectManager module

31 March 2009 at 8:59am Last edited: 31 March 2009 9:00am
One more ...
If i set $sourceSort in the constructor of DataObjectManager(...) nothing is sorted. Please removeprotected function loadSort() {
if($this->ShowAll())
$this->setPageSize(999);
if($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) {
$this->sort = "SortOrder";
$this->sourceSort = "SortOrder ASC";
}
elseif(isset($_REQUEST['ctf'][$this->Name()]['sort']))
$this->sourceSort = $_REQUEST['ctf'][$this->Name()]['sort'] . " " . $this->sort_dir;
else
$this->sourceSort = null;
} -
Re: Preview: DataObjectManager module

31 March 2009 at 2:20pm
Hi, hopefully an easy question - How can I reverse the default sorting? Currently the oldest object is displayed first but ideally the newest one would be... any ideas?
-
Re: Preview: DataObjectManager module

31 March 2009 at 4:24pm
Default sort is the 7th (8th in filedataobjectmanager) argument of the field. Check the api on complextablefield.
-
Re: Preview: DataObjectManager module

31 March 2009 at 9:52pm
I had a play with that and added 'DESC' which didn't do anything, so I tried 'ASC' then 'Date DESC' etc but nothing made a difference. Is there something that I am doing wrong?
$manager = new DataObjectManager(
$this, // Controller
'PlanningComments', // Source name
'PlanningComment', // Source class
array('Date' => 'Date', 'Name' => 'Name', 'PlanningComment' => 'Comment'), // Headings
'getCMSFields_forPopup', // Detail fields function or FieldSet
'', // Filter clause
'DESC', // Sort clause
''// Join clause
| 54218 Views | ||
| Go to Top | Next > |

