Flexpadawan
Flexpadawan

Reputation: 77

ExtJS - Elegant Date Time Picker

I've found what I'm looking for but it's a jQuery example, it looks super clean and intuitive. Is there a way to do this with xtype 'datefield'? Is there a way to extend this field type to include a clock icon beside the date icon and have it behave the same way as in this example?

http://jsfiddle.net/rniemeyer/T3zge/

ko.kendo.bindingFactory.createBinding({
    name: "kendoDateTimePicker",
    defaultOption: "value",
    events: {
        change: "value",
        open:
        {
            writeTo: "isOpen",
            value: true
        },
        close: {
            writeTo: "isOpen",
            value: false
        }
    },
    watch: {
        enabled: "enable",
        max: "max",
        min: "min",
        value: "value",
        isOpen: ["open", "close"]
    }
});

var viewModel = {
   myDate: ko.observable(new Date())
};

ko.applyBindings(viewModel);

I'm still very much a newbie at this so perhaps somebody can lend some advice or point me in the right direction how I can figure this out. Thanks in advance! :)

Upvotes: 1

Views: 11293

Answers (2)

Guilherme Lopes
Guilherme Lopes

Reputation: 4760

I have created a DateTime plugin for ExtJS 4 and 5 few months ago. Give it a try, its a little different than what you showed but works as intended:

https://github.com/gportela85/DateTimeField

Hope it helps

Upvotes: 7

Scriptable
Scriptable

Reputation: 19758

Extjs does have a separate Time Picker, but not a date/time picker combined. You would likely need to create a plugin, but if you are fairly new to this you may find it a little overwhelming.

You could search the forums for custom extensions/plugins people have created, I just came across this one for ExtJs 4.

Upvotes: 0

Related Questions