[ 4 posts ]

mark.kharitonov

  • Joined: Sat Sep 15, 2012 3:12 am
  • Posts: 217
  • Offline
  • Profile

How to refresh the query programmatically.

Post Posted: Sat Sep 22, 2012 9:20 am
+0-
My page has an instant search and an advanced search. One can switch from the instant to advanced and back.

I would like when switching from the instant to advanced to refresh the advanced query UI to reflect the current instant search criteria.

For example, when the instant search query equals "abc", the respective advanced search query should refresh to "Item contains abc".

To get the general idea see http://ec2-23-22-204-49.compute-1.amazo ... ntory.html

What I do not understand is how to change the query programmatically?

Thanks.

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 358
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile
Tags:

Re: How to refresh the query programmatically.

Post Posted: Sat Sep 22, 2012 9:36 am
+0-
Use reset() to clear the QueryBuilder and then appendNew() to add items:

http://jafl.github.com/yui3-gallery/yui ... _appendNew

mark.kharitonov

  • Joined: Sat Sep 15, 2012 3:12 am
  • Posts: 217
  • Offline
  • Profile
Tags:

Re: How to refresh the query programmatically.

Post Posted: Sat Sep 22, 2012 6:45 pm
+0-
I must be missing something, because I still do not understand how to set the query builder to display Item contains abc.

Calling appendNew allows to select the Item. But it does not seem to allow to choose the operation.

Could you give an example, please?

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 358
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: How to refresh the query programmatically.

Post Posted: Sun Sep 23, 2012 8:36 am
+0-
The "value" argument to appendNew() is passed to the plugin to initialize the values beyond the first column. Each plugin documents what is required. For example, String wants [ operator_name, value ]:

http://jafl.github.com/yui3-gallery/yui ... tring.html

And Select wants just the value:

http://jafl.github.com/yui3-gallery/yui ... elect.html

So, for String, you would call appendNew(var_name, [ operator_name, value ])
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum