简体   繁体   中英

sproutcore orderBy other controller

in one of my ListViews I display besides several 'office' properties a 'distance' property belonging to an other controller and the orderBy is only working for/with the 'office' model properties.

Background: I have an input field for an postalcode used in a query to get the distances between this postalcode and all of our office postalcodes. The obtained distances are in a second controller.

Please some advice how to get the distance orderBy working.

The easiest would be to add a computed property to the model which retrieves the distance from the controller in which you have the information. In order for the orderBy to work, it needs to seem to the array controller / list view combination that the property you want to sort on is a property of the object displayed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM