1. #1
    Sencha User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    pauljtaylor is on a distinguished road

      0  

    Default Unanswered: Timefield in EditorGrid: prior value in pulldown

    Unanswered: Timefield in EditorGrid: prior value in pulldown


    Hey, everyone.

    I've got a gridPanel in 4.07 with the rowEditing plug-in. I've got a field for the end time of a task:

    PHP Code:
    {
         
    header'End Time',
         
    dataIndex'endtime',
         
    width80,
         
    editor: {
              
    xtype'timefield',
              
    allowBlanktrue
         
    }

    I can add a row and choose, say, 3:30 PM as the end time.

    If I add another row after that, I'll expand the end time picker, and 3:30 PM is highlighted and not selectable. Likewise, if I choose a row to edit that already has data (the end time in that row may be 2:30 PM, for example), the picker still has 3:30 PM highlighted and unavailable, where the expected behavior is that 2:30 PM would be the unavailable choice. The only work around is to choose another time like midnight... that will lock 12:00 AM and make 3:30 PM available for choosing.

    Is there something I'm setting up incorrectly? I've stripped down the configs of the timefield to the bare bones, but maybe that's the problem...?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I'm not seeing this in our latest code but it sounds like the value just isn't being cleared.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

  3. #3
    Sencha User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    pauljtaylor is on a distinguished road

      0  

    Default


    I've tried setting defaultValue: new Date(), but the picker still highlights and locks the prior selection. I'm not sure how to clear out the picker value, or to tell the control I don't want any values disabled despite making logical sense to prevent a user from selecting the value that was already in the field.

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    9
    Vote Rating
    0
    adisharoon is on a distinguished road

      0  

    Default


    I'm having the same problem. The reset() method of the time field also doesn't help - the value resets, but the last selected option in the picker is still highlighted.

    This presents a problem when multiple rows in the EditorGrid need the same time - first a different time has to be selected, then the original time reselected.

  5. #5
    Sencha User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    pauljtaylor is on a distinguished road

      0  

    Default


    Yes, this is exactly the problem I am having in my application, which is basically a timesheet. Many of the employees work from 9:00 AM to 5:00 PM, and once 9:00 AM is selected as the start time in the first row, something else has to be entered into the second before 9:00 AM is freed up.

    I am having them just type military time into the field as a workaround for now.

  6. #6
    Sencha User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    pauljtaylor is on a distinguished road

      0  

    Default


    I've been trying to override Ext.form.field.Time's onExpand function. There seems to be some code that makes the prior value highlight. Having no luck, though.

    PHP Code:
    Ext.override(Ext.form.field.Time,{
        
    onExpand: function(){
            var 
    me this,
            
    keyNav me.pickerKeyNav,
            
    selectOnTab me.selectOnTab,
            
    picker me.getPicker(),
            
    lastSelected picker.getSelectionModel().lastSelected,
            
    itemNode;

            if (!
    keyNav) {
                
    keyNav me.pickerKeyNav Ext.create('Ext.view.BoundListKeyNav'this.inputEl, {
                    
    boundListpicker,
                    
    forceKeyDowntrue,
                    
    tab: function(e) {
                        if (
    selectOnTab) {
                            if(
    me.picker.highlightedItem) {
                                
    this.selectHighlighted(e);
                            } else {
                                
    me.collapse();
                            }
                        
    me.triggerBlur();
                        }            
                    return 
    true;
                    }
                });
                if (
    selectOnTab) {
                    
    me.ignoreMonitorTab true;
                }
            }
            
            
    Ext.defer(keyNav.enable1keyNav);
            
            if (
    lastSelected) {
                
    //picker.clearHighlight();
            
    }
        }
    }); 

  7. #7
    Sencha User
    Join Date
    Nov 2009
    Location
    Milton Keynes, England
    Posts
    18
    Vote Rating
    0
    Answers
    2
    tomearly is on a distinguished road

      0  

    Question


    Hi,

    I'm having exactly the same problem. Only seems to happen with a timefield.

    I modified the Ext.grid.plugin.RowEditing to include a timefield (changed the email field to timefield) and can replicate the exact same problem.

    Did anyone fix this?

    Thanks,

    Tom