Discuss anything related to web development but no technical support questions


Post by mfrancia »

hi

i have a new requeriment of a user, i need a calendar for a fast search of a specific day and cant permit to redict to the tasks of that day.

thanks,

Post by mats »

It should be simple to just add an Ext DatePicker as seen here: https://dev.sencha.com/deploy/dev/exampl ... menus.html

And in its handler, just update the scheduler by calling "setView(start, end)"...
var dateMenu = new Ext.menu.DateMenu({
        handler: function(dp, date){
            Ext.example.msg('Date Selected', 'You chose {0}.', date.format('M j, Y'));
        }
    });


Post by mfrancia »

hi

ok i see the example but its not clear to me, this is a menu right, it can be locate in the tbar as another item? or its necesary set the menu

thanks

Post by mats »

Yes the menu can be part of a button in a tbar. See the source here: https://dev.sencha.com/deploy/dev/examples/menu/menus.js

Post by mfrancia »

hi Mats

im not sure how to call menu, i tried this
 tbar: [
 {
                text: 'calendar',
                handler:function () {
                    var menu = new Ext.menu.Menu({
                        id: 'mainMenu',
                        style: {
                            overflow: 'visible'     // For the Combo popup
                        },
                        items: [

                             { text: 'Choose a Date',
                                 iconCls: 'calendar',
                                 menu: dateMenu // <-- submenu by reference
                             }
                        ]
                    });
                }],
please could you guide me the right way thanks

Post by mats »

Almost right:
tbar: [{
                    text: 'calendar',
                    menu : new Ext.menu.DateMenu({
                        handler: function(dp, date){
                            Ext.Msg.alert('Date Selected', 'You chose ' + date.format('M j, Y'));
                        }
                    })
                }]

Post Reply