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

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

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: 04/7/13
    + 1 -

    John Lindal

    YUI Contributor

    See 50 more by this user.

    Created: 12/4/09
    Last CDN Push: 01/16/13
    Build Tag: gallery-2013.01.16-21-05
    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:
    • jafl
    • query
    • filter
    • expression
    • 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-2013.01.16-21-05'
    }).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-2013 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