1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    18
    Vote Rating
    0
    Answers
    3
    hornetnz is on a distinguished road

      0  

    Default Answered: Datepicker - cant select weekend!

    Answered: Datepicker - cant select weekend!


    I found out today that our datepicker columns are unable to select Saturday/Sunday. You can click them, but the date automatically gets forwarded to the next Monday. Is there a config option I'm overlooking??

    HTML Code:
    columns: [
                    { xtype: 'actioncolumn', width: 30,
                        items: [{
                            icon: '/images/information.png',
                            tooltip: 'Click to show Workflow details in this Group',
                            handler: function (grid, rowIndex, colIndex) {
                                var rec = grid.getStore().getAt(rowIndex);
                                var workflowArrayName = rec.get('Name');
                                var popup = Ext.create('Ext.window.Window', {
                                    title: workflowArrayName + ' - Group Details',
                                    height: 400,
                                    width: 750,
                                    layout: 'fit',
                                    modal: true,
                                    items: {
                                        itemId: 'arraygrid',
                                        xtype: 'arraygrid',
                                        border: false
                                    }
                                });
    
                                var workflowArrayId = rec.get('WorkflowArrayId');
                                var tree = popup.down('#arraygrid');
                                tree.store.load({ url: '/Planner/WorkflowArrayGantt.aspx/GetComponents?workflowArrayId=' + workflowArrayId });
                                popup.show();
                            }
                        }]
                    },
                    { xtype: 'treecolumn', header: 'Groups', dataIndex: 'Name', width: 150 },
                    { xtype: 'startdatecolumn', width: 84, header: 'Start', dataIndex: 'StartDate', editor: { xtype: 'datefield', listeners: { select: this.onDateSelect } } },
                    { xtype: 'enddatecolumn', width: 84, header: 'Finish', dataIndex: 'EndDate', editor: { xtype: 'datefield', allowBlank: true, listeners: { select: this.onDateSelect } } }
                ],

  2. The solution that worked for me was to add "weekendsAreWorkdays: true," to the config. Thanks for everyones ideas!

  3. #2
    Sencha User
    Join Date
    Nov 2012
    Posts
    18
    Vote Rating
    0
    Answers
    3
    hornetnz is on a distinguished road

      0  

    Default


    On further inspection, it appears the date is changing on the blur event, but I dont have any handlers or functions setup for that event...

  4. #3
    Sencha User
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    34
    Vote Rating
    4
    Answers
    2
    Ilay is on a distinguished road

      0  

    Default


    Maybe setDisabledDays function helps to you. Also you can add listeners on Select event of Datepicker and handle selected date.

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I'm not able to reproduce the issue.
    Are you seeing the same behavior when you use this example:
    http://docs.sencha.com/ext-js/4-2/ex.../#cell-editing

  6. #5
    Sencha User
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    34
    Vote Rating
    4
    Answers
    2
    Ilay is on a distinguished road

      0  

    Default


    Quote Originally Posted by slemmon View Post
    I'm not able to reproduce the issue.
    Are you seeing the same behavior when you use this example:
    http://docs.sencha.com/ext-js/4-2/ex.../#cell-editing
    i see below configuration
    Code:
    editor: {
                        xtype: 'datefield',                    format: 'm/d/y',                    minValue: '01/01/06',                    disabledDays: [0, 6],                    disabledDaysText: 'Plants are not available on the weekends'                 }
    disabledDays: [0, 6] i think thats resolve a problem of hornetnz.
    slemmon it's a real good example. Thanks.

  7. #6
    Sencha User
    Join Date
    Nov 2012
    Posts
    18
    Vote Rating
    0
    Answers
    3
    hornetnz is on a distinguished road

      0  

    Default


    The solution that worked for me was to add "weekendsAreWorkdays: true," to the config. Thanks for everyones ideas!

Thread Participants: 2

Tags for this Thread