Results 1 to 2 of 2

Thread: Ext.ux.form.FullQuery

  1. #1
    Sencha User willf1976's Avatar
    Join Date
    May 2009
    Location
    carpinteria, ca
    Posts
    84
    Vote Rating
    0
      0  

    Default Ext.ux.form.FullQuery

    Hi All

    I have been going through the classes we have developed and sharing back with the community some of them that I think will be useful to others. These components have been tested in ext-3.2.1.

    Here is: Ext.ux.form.FullQuery

    a plug in that sends all the form field values on query for a searchable combo box. Useful for when you want to refine search criteria by the content of other fields in the form.

    Code:
    /**
     * @author Will Ferrer, Ethan Brooks
     * @copyright (c) 2012, Intellectual Property Private Equity Group
     * @licensee 2012 developed under license for Switchsoft LLC http://www.switchsoft.com a "Direct response telephony company" as part of it's "VOIP Call distribution, ROI analysis platform, call recording, and IVR for inbound and outbound sales" and Run the Business Systems LLC a "Technology development investment group" as part of it's "PHP, Javascript rapid application development framework and MySQL analysis tools"
     * @license licensed under the terms of
     * the Open Source LGPL 3.0 license.  Commercial use is permitted to the extent
     * that the code/component(s) do NOT become part of another Open
    Source or Commercially
     * licensed development library or toolkit without explicit permission.
     * <p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
     * target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
    * We are pretty nice just ask. We want to meet our licensees
    */
    
    /**
     * @class Ext.ux.form.FullQuery
     * @extends Ext.util.Observable
     * a plug in that sends all the form field values on query for a searchable combo box. Useful for when you want to refine search criteria by the content of other fields in the form.
     * @param {Object} config The config object
     * @ptype ux-form-fullquery
     */
    Ext.ns('Ext.ux.form');
    Ext.ux.form.FullQuery = function(config){
        Ext.apply(this, config);
        Ext.ux.form.FullQuery.superclass.constructor.call(this);
    };
    Ext.extend(Ext.ux.form.FullQuery, Ext.util.Observable, {
        // @private
        parent : null,
        // @private
        init: function(parent) {
            this.parent = parent;
            this.parent.fullQuery = this;
            this.parent.on('beforequery', this.onBeforeQuery, this.parent);
        },
        // @private
        onBeforeQuery : function (queryEvent) {
            var searchElem = this,
                values, baseParams;
            while(!Ext.isEmpty(searchElem.ownerCt)) {
                searchElem = searchElem.ownerCt;
                if (searchElem.xtype=='form') {
                    formElem = searchElem;
                    break;
                }
            };
            values = formElem.getForm().getValues();
            baseParams = (!Ext.isEmpty(formElem.getForm().baseParams))?formElem.getForm().baseParams:{};
            values['query'] = queryEvent['query'];
            values =  Ext.apply(baseParams, values);
            queryEvent['query'] = Ext.encode(values);
            
        }
    });
    Ext.preg('ux-form-fullquery', Ext.ux.form.FullQuery);
    Best regards

    Will Ferrer (Run the Business)

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1270
      0  

    Default

    Thanks for the contribution!
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •