Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » ModelAdmin sorting & relationships

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

Page: 1
Go to End
Author Topic: 744 Views
  • kinglozzer
    Avatar
    Community Member
    138 Posts

    ModelAdmin sorting & relationships Link to this post

    Hi guys,

    Testing out SS3, have been building a news section from scratch.

    Each news article 'has_one' author, and author name is being displayed as a summary field. I would like to be able to have the option of sorting by author name by clicking on the table header, like I can with date/title.

    Is this possible? Or have I set my relationships up wrong or something?

    Thanks,
    Lawrence

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: ModelAdmin sorting & relationships Link to this post

    Hi:
    I need this feature too, by default it allow ID column to be sorted but not all of the other columns , IF you have a look at the Security section-> member table ,you notice that you can sort by E-mail, First name or last name .. so maybe if we find the correct .php files we can find a good example ;)

    let me know if you find anything, I also will be looking into it in my free time

  • camfindlay
    Avatar
    Forum Moderator
    146 Posts

    Re: ModelAdmin sorting & relationships Link to this post

    www.ssbits.com/tutorials/2011/sorting-on-a-related-dataobject-in-modeladmin/

    That might help out, I think it is aimed at 2.4 but could perhaps be adapted for ss3

    744 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.