batman set sortBy desc

121 views
Skip to first unread message

yann...@gmail.com

unread,
Jun 24, 2012, 11:47:31 AM6/24/12
to batm...@googlegroups.com
Good morning
I have a batman set that needs to be sorted desc
data-foreach-notice="Notice.all.sortedBy('created_at', 'desc')"
but i get this error
Couldn't parse keypath in "Notice.all.sortedBy("created_at", "desc")". Parsing error above.

please help

John Lynch

unread,
Jun 24, 2012, 11:58:55 AM6/24/12
to batm...@googlegroups.com
Going from memory here, but try Notice.all.sortedByDescending.created_at

- john
Message has been deleted

yann...@gmail.com

unread,
Jun 24, 2012, 1:08:05 PM6/24/12
to batm...@googlegroups.com
thanks man it worked. You're a life saver

Ryan Jones

unread,
Jul 3, 2012, 3:32:49 PM7/3/12
to batm...@googlegroups.com
I did a couple articles trying to clear up some confusion on accessors and view filters:


Let me know if they help at all!

Michael van Rooijen

unread,
Jan 16, 2013, 1:49:51 PM1/16/13
to batm...@googlegroups.com
Any idea how you could sort based on an attribute in an associated model?

@set "users", App.User.get("all.sortedBy.group.name")

This won't work because it's sorted it by "group" and not "group name". I tried 

@set "users", App.User.get("all.sortedBy.group[name]")
@set "users", App.User.get("all.sortedBy[group].name")
@set "users", App.User.get("all.sortedBy[group.name]")

I'm not sure whether you can accomplish this in using just key paths since it seems to only take the first key (group) as an argument and the 2nd (name) is ignored.

Any ideas?

Thanks!

Jeff Berg

unread,
Jan 16, 2013, 1:53:14 PM1/16/13
to batm...@googlegroups.com
Maybe:

@set "users", App.User.get("all.sortedBy").get("group.name")

I don't have a batman project open to test this out for you, but just an idea. 

Jeff
--
Jeff Berg
Owner/Developer
Ministry Centered Technologies
=================================
REVOLUTIONIZE the way you plan your SERVICES at planningcenteronline.com
REVOLUTIONIZE the way you plan your EVENTS at smartevents.com
Reply all
Reply to author
Forward
0 new messages