I have a search that returns returns say 1 to 1000 rows, and I want to display the LAST 10 (or n) (or fewer, if there are <10 rows returned) instead of the FIRST 10 (assuming results.count is 10). I was trying to manipulate results.offset dynamically with a ValueSetter, with no luck. I don't really want to reverse sort the data.
Just use PostProcess to reverse the result set. Hopefully your unwillingness to use reverse was more of an unwillingness to use reverse in the base search? Otherwise I don't really see the drawback if there are only 1000 rows.
<module name="PostProcess">
<param name="search">reverse</param>
<module name="Pager">
<module name="Table" />
</module>
</module>
Technically, you probably could manipulate $results.offset$ and $results.count$ as they come off the Pager, but before they hit the Table, but you're going to have to dispatch a stats count search to do it, or write a JS customBehavior, and either of those seem like a worse idea than a reverse. =/
Thanks for the answer/feedback. The data is coming in a timechart with oerformance statistics in 5 minute intervals ... and I think of it being ordered oldest to newest with the newest at the bottom.... and that's how I would normally view it.. I'm most interested in the most recent 50 or 60 minutes worth of data from a display/dashboard real estate perspective, but I may want to page back to see a historical view (the search might return most recent 3 or 5 hours of 5 minute intervals). I tried messing with $results.offset$ and $results.count$ pager/table/values but debug showed that they seemed to be getting the values that were there "before" the the query/rendering completed, if that makes sense. Admittedly I don't have my head wrapped around all of the intricacies of how and when stuff gets processed, so not ready to tackle custom behaviors yet. Thanks.
Cool. Well the PostProcess should give you what you want. There are some pretty thorough docs in Sideview Utils about using PostProcess in general. They go into detail about situations with a little more going on than this, but still worth reading.