So I created like pop-up window and adding students.
The everything works fine. I can add students and I can list them.
The student list order show oldest to newest by adding order.
I wish that I can sort student by name at CMS.
Is this possible?
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
So I created like pop-up window and adding students.
The everything works fine. I can add students and I can list them.
The student list order show oldest to newest by adding order.
I wish that I can sort student by name at CMS.
Is this possible?
There is a 7th parameter $sourceSort for the (HasMany)ComplexTableField - so this might work (based on the code from the tutorial):
$tablefield = new HasOneComplexTableField(
$this,
'MyStudent',
'Student',
array(
'FirstName' => 'First Name',
'Lastname' => 'Family Name',
'Nationality' => 'Nationality'
),
'getCMSFields_forPopup',
null,
'Lastname'
);
Thanks martimiz.
It's working.