17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1207 Views |
-
Peeking ahead in a DataObjectSet

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?
-
Re: Peeking ahead in a DataObjectSet

23 September 2008 at 3:58pm
never really used it but having alot at DataObjectSet.php there is a peekNext() method and a peekPrev() ?
-
Re: Peeking ahead in a DataObjectSet

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 %>
do something
<% end_if %>
<% end_control %> -
Re: Peeking ahead in a DataObjectSet

25 September 2008 at 10:48pm
Lazy loading is on the todo list, we've brainstormed and created a development plan:
http://open.silverstripe.com/wiki/development/NewDataMapperWould be great to get your feedback through the dev mailinglist (http://groups.google.com/group/silverstripe-dev)
| 1207 Views | ||
|
Page:
1
|
Go to Top |


