Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

2.4.5 - How can I add sorting MemberTableField?


Reply


4 Posts   499 Views

Avatar
flipsidenz

Community Member, 49 Posts

28 August 2012 at 8:53pm

I want to be able to add sorting/ordering to the MemberTableField - how can I go about this?

I've created an additional summary field for 'Created Date', so I can sort by this column to see the newest members.

Avatar
Sean

Forum Moderator, 922 Posts

29 August 2012 at 12:23pm

Edited: 29/08/2012 12:44pm

Hi there,

Are the headers in the table not clickable to resort the results, is that what you were after?

EDIT: Just realised you're on 2.4, see my post below for a patch to add sorting.

Cheers,
Sean

Avatar
Sean

Forum Moderator, 922 Posts

29 August 2012 at 12:43pm

I've patched MemberTableField to support sorting in SilverStripe 2.4.
This didn't exist initially because MemberTableField was extended from ComplexTableField, but the sorting functionality was missed.

SilverStripe 3 has since allowed for sorting in the Security section, however this patch is useful for those still on 2.4.x.

I've attached the patch to this ticket.

Let me know how you get on. :)

Cheers,
Sean

Attached Files
Avatar
flipsidenz

Community Member, 49 Posts

31 August 2012 at 1:38pm

Yes, perfect. Exactly what I was looking for.

Thank you for your assistance. Look forward to trialling 3.0 soon.