• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • Tutorials
    • API Docs
  • Community
    • Gallery
    • Blog »
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • YUI 2
    • YUI Compressor
    • YUI Doc »
    • YUI Builder
    • YUI PHP Loader
    • YUI Test
    • YUI Website
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

jafl plugin io datatable nzakas node async event lsmith davglass css model animation satyam form foxxtrot table widget solmsted liferay yql caridy ericf apipkin greghinch

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Query Builder (gallery-querybuilder) on cdn

    Last Updated: 05/10/12
    + 1 -

    John Lindal

    YUI Contributor

    See 43 more by this user.

    Created: 12/4/09
    Last CDN Push: 7 hours ago
    Build Tag: gallery-2012.05.16-20-37
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.5.1
    Free for use.

    QueryBuilder provides a way for users to construct a set of filter conditions. The widget is constructed with a set of variables. For each item that the user adds to the list, the user chooses a variable and then a condition for that variable. It is up to the application to decide whether the conditions should be AND'ed or OR'ed.

    • Tags:
    • expression
    • filter
    • query
    • jafl
    • sql
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    This example creates a QueryBuilder with five variables: url, impressions, ctr, flag, and submission_status. The validation attached to each variable is compatible with Y.FormManager (gallery-formmgr).

    Code Sample

    <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2012.05.16-20-37'
    }).use('gallery-querybuilder', function(Y)
    {
    	var var_list =
    	[
    		{
    			name: 'url',
    			type: 'string',
    			text: 'URL',
    			validation: 'yiv-length:[,3000]'
    		},
    		{
    			name: 'impressions',
    			type: 'number',
    			text: 'Impressions (1000s)',
    			validation: 'yiv-integer'
    		},
    		{
    			name: 'ctr',
    			type: 'number',
    			text: 'Click-through rate (%)',
    			validation: 'yiv-decimal:[0,]'
    		},
    		{
    			name: 'flag',
    			type: 'select',
    			text: 'Flagged',
    			value_list:
    			[
    				{ value: "true",  text: 'True' },
    				{ value: "false", text: 'False' }
    			]
    		},
    		{
    			name: 'submission_status',
    			type: 'select',
    			text: 'Status',
    			value_list:
    			[
    				{ value: "I", text: 'Action Required' },
    				{ value: "S", text: 'Submitted' },
    				{ value: "A", text: 'Submission Accepted' },
    				{ value: "B", text: 'Submission Auto-Accepted' }
    			]
    		}
    	];
     
    	var ops =
    	{
    		string:
    		[
    			{ value: 'equal',       text: 'Is' },
    			{ value: 'contains',    text: 'Contains' },
    			{ value: 'starts-with', text: 'Starts with' },
    			{ value: 'ends-with',   text: 'Ends with' }
    		],
     
    		number:
    		[
    			{ value: 'equal',         text: '= Equals' },
    			{ value: 'less',          text: '< Less than' },
    			{ value: 'less-equal',    text: '<= Less than or equal to' },
    			{ value: 'greater',       text: '> Greater than' },
    			{ value: 'greater-equal', text: '>= Greater than or equal to' }
    		],
     
    		select:
    		[
    			'EQUALS'
    		]
    	};
     
    	var query = new Y.QueryBuilder(var_list, ops);
    	query.render('#query');
     
    });

    Forum Posts

    Subject Author Date
    query builder does not apply filter to the yui3 datatable Neal Buckley 07/9/11
    Re: query builder does not apply filter to the yui3 datatabl John Lindal 07/11/11
    Re: query builder does not apply filter to the yui3 datatabl Neal Buckley 07/11/11
    Re: query builder does not apply filter to the yui3 datatabl John Lindal 07/11/11
    Re: query builder does not apply filter to the yui3 datatabl Neal Buckley 07/14/11
    Re: query builder does not apply filter to the yui3 datatabl John Lindal 07/14/11
    Re: query builder does not apply filter to the yui3 datatabl Neal Buckley 07/15/11
    Re: query builder does not apply filter to the yui3 datatabl John Lindal 07/15/11
    Re: query builder does not apply filter to the yui3 datatabl Neal Buckley 07/15/11
    Re: query builder does not apply filter to the yui3 datatabl John Lindal 07/15/11

    © 2006-2011 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info