Conditionally adding items to a list/group

9 views
Skip to first unread message

Brian Hayward

unread,
Mar 21, 2013, 12:08:49 AM3/21/13
to mo...@googlegroups.com

I have something like this:

whenLoaded(searchItems)
{
   group {
     list(it in searchItems) {
        item {  checkBox(it.selected, it.name) }
     }
  }
}

I'd like to do this:

whenLoaded(searchItems)
{
  group {
     list(it in searchItems) {
        if( ! inLocalDB(it) )
        {
          item {  checkBox(it.selected, it.name) }
        }
     }
  }
}

Except you can't add an "if" inside a group.  Any suggestions?  Haven't had much luck digging through the docs.

Thanks,
Brian

Brian Hayward

unread,
Mar 21, 2013, 12:20:11 AM3/21/13
to mo...@googlegroups.com
Also, searchItems is the result of an AJAX call.

Chris Melman

unread,
Mar 21, 2013, 3:35:39 AM3/21/13
to mo...@googlegroups.com
In ui elements when is used instead of if, because it describes better the reactive behavior.

Greetings chris


Date: Wed, 20 Mar 2013 21:20:11 -0700
From: bhay...@gmail.com
To: mo...@googlegroups.com
Subject: [mobl] Re: Conditionally adding items to a list/group
--
You received this message because you are subscribed to the Google Groups "mobl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobl+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brian Hayward

unread,
Mar 21, 2013, 10:58:43 PM3/21/13
to mo...@googlegroups.com
Thanks, it's working now. :)
--Brian
Reply all
Reply to author
Forward
0 new messages