-
1 Dec 2011 12:43 PM #1
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:
I can add a row and choose, say, 3:30 PM as the end time.PHP Code:{
header: 'End Time',
dataIndex: 'endtime',
width: 80,
editor: {
xtype: 'timefield',
allowBlank: true
}
}
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 Dec 2011 7:49 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Dec 2011 8:16 AM #3
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.
-
5 Dec 2011 7:41 AM #4
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 Dec 2011 7:47 AM #5
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.
-
5 Dec 2011 11:54 AM #6
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, {
boundList: picker,
forceKeyDown: true,
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.enable, 1, keyNav);
if (lastSelected) {
//picker.clearHighlight();
}
}
});
-
28 Feb 2012 11:59 PM #7
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


Reply With Quote