Coder Social home page Coder Social logo

ghuntley / ext.ux.touch.datetimepicker Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 10.0 349 KB

Sencha Touch plugin that extends Ext.Picker to provide a Date/Time functionality.

Home Page: http://www.ghuntley.com/

License: MIT License

JavaScript 95.57% HTML 4.43%

ext.ux.touch.datetimepicker's Introduction

Ext.ux.touch.DateTimePicker

This extension provides a DateTimePicker for the Sencha Touch framework by extending Ext.Picker.

Usage

datetimePicker = new Ext.ux.touch.DateTimePicker({
    useTitles: true,
    id: 'dt',
    value: {
        day: 23,
        month: 2,
        year: 2000,
        hour: 13,
        minute: 45
    },
    listeners: {
        "hide": function(picker) {
            window.alert((picker.getValue()));
        }
    }
}).show();

Screenshot

Ext.ux.touch.DateTimePicker

ext.ux.touch.datetimepicker's People

Contributors

ghuntley avatar olegtaranenko avatar sylvaindeschenes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ext.ux.touch.datetimepicker's Issues

How to use with xtypes?

So I've got the following code:

            items: [
                # Fields
                {
                    xtype: "fieldset"
                    defaults: 
                        required: true
                        labelAlign: "left"
                        labelWidth: "40%"
                    items: [ 
                            xtype: "textfield"
                            name: "name"
                            label: "Name"
                            placeHolder: 'My Event'
                            useClearIcon: true
                        , 
                            xtype: "textfield"
                            name: "description"
                            label: "Description"
                            placeHolder: 'is awesome'
                            useClearIcon: true
                        , 
                            new Ext.ux.touch.DateTimePicker(
                                useTitles: true
                                id: "dt"
                                value: 
                                    day: 23
                                    month: 2
                                    year: 2000
                                    hour: 13
                                    minute: 45
                                listeners: hide: (picker) ->
                                    window.alert (picker.getValue())
                            )
                    ]
                },

                # Actions
                {
                    xtype: "fieldset"
                    items: [ 
                        xtype: "button"
                        text: "Submit Event"
                        ui: "confirm"
                        handler: ->  
                            Evently.Views.eventForm.submit waitMsg: 
                                message: "Submitting"
                                cls: "demos-loading"
                    ]
                }
            ]

However that is not rendering the DateTimePicker correctly, is there a way to use it with xtypes like the other two fields?

Scrollwheel not supported

Hi, thanks for developing this component. We are using it in a old project, and it seems that the "official" scrollwheel patch doesn't work. This is the code on sencha forums to be able to use the mouse scrollwheel when on desktop. It works with the rest of lists and pickers, but not with yours. Do you know how can we solve it? Thanks!!

if (Ext.os.is.Desktop)
{
// Native scrolling in Browser
document.addEventListener('mousewheel', function(e){
var el = e.target;
var offset, scroller, _results;
_results = [];
while (el !== document.body) {
if (el && el.className && el.className.indexOf('x-container') >= 0) {
var cmp = Ext.getCmp(el.id);
if (cmp && typeof cmp.getScrollable == 'function' && cmp.getScrollable()){
var scroller = cmp.getScrollable().getScroller();
if (scroller) {
var offset = {x:0, y: -e.wheelDelta*0.5};
scroller.fireEvent('scrollstart', scroller, scroller.position.x, scroller.position.y, e);
scroller.scrollBy(offset.x, offset.y);
scroller.snapToBoundary();
scroller.fireEvent('scrollend', scroller, scroller.position.x, scroller.position.y-offset.y);
break;
}
}
}
_results.push(el = el.parentNode);
}
return _results;
}, false);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.