1. #1
    Sencha User willf1976's Avatar
    Join Date
    May 2009
    Location
    carpinteria, ca
    Posts
    82
    Vote Rating
    0
    willf1976 is on a distinguished road

      0  

    Default Ext.ux.form.TimeFieldPlus

    Ext.ux.form.TimeFieldPlus


    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.TimeFieldPlus

    an extended timefield that allows additional values to be plugged into it

    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 TimeFieldPlus
     * @extends Ext.form.TimeField
     * an extended timefield that allows additional values to be plugged into it
     * @constructor
     * @param {Object} config The config object
     * @xtype ux-form-timefieldplus
     */
    Ext.ns('Ext.ux.form');
    Ext.ux.form.TimeFieldPlus = Ext.extend(Ext.form.TimeField, {
        /**
        * @cfg {Array} additionalValues
        * extra values to put in the time field. Defaults to [].
        */
        additionalValues : [],
        // @private
        generateStore: function(initial){
            var min = this.minValue || new Date(this.initDate).clearTime(),
                max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1),
                times = [];
    
            while(min <= max){
                times.push(min.dateFormat(this.format));
                min = min.add('mi', this.increment);
            }
            times = times.concat(this.additionalValues);
            this.bindStore(times, initial);
        },
    });
    Ext.reg('ux-form-timefieldplus', Ext.ux.form.TimeFieldPlus);
    Best regards

    Will Ferrer (Run the Business)

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thanks for the contribution!
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

Tags for this Thread