17452 Posts in 4473 Topics by 1971 members
|Go to End|
23 September 2008 at 8:41am
I know it's possible to "peek" ahead or behind in a DataObjectSet. That is, look at the next or previous record without changing the iterator. What I'm wondering is, how do I use this function? What I'd like to do is when my DOSet is in a control, I need to make a decision while in the loop that depends on the next record. For instance, if the value of the next record is the same as the current record, open a new div.. otherwise, don't.
Does that make sense? And if so, is this supported?
23 September 2008 at 3:58pm
never really used it but having alot at DataObjectSet.php there is a peekNext() method and a peekPrev() ?
24 September 2008 at 1:16am
Yeah, that looks right, but I guess I'm not sure how to use it in a template. Could it be as simple as
<% control MyDOs %>
<% control peekNext %>
<% if Value = peekPrev.Value %>
<% end_if %>
<% end_control %>
25 September 2008 at 10:48pm
Lazy loading is on the todo list, we've brainstormed and created a development plan:
Would be great to get your feedback through the dev mailinglist (http://groups.google.com/group/silverstripe-dev)
|Go to Top|