pym
5 Jan 2011, 12:01 AM
I'm using a time field for start/end times.
initially I was using renderer: Ext.util.Format.dateRenderer('H:i:s') which displayed the time as
I wanted - but any edits caused a NaN. Following the existing forum posts I swiched to
a custom renderer which did nothing (except I'm guessing cast from string to date) and it did
make the editing functional - however the display when not editing is now the full date string.
var timeEditor = new fm.TimeField({format:'H:i:s', minValue: '0:01 AM', maxValue: '4:00 AM', increment: 1});
function renderTime(value){
return value;
};
{header: 'Start',width: 180,dataIndex: 'start_time', editor: timeEditor, renderer: renderTime},
{header: 'End',width: 180,dataIndex: 'end_time',editor: timeEditor, renderer: renderTime},
I've seen (and tried) various renderTime workaround examples like if value.length== 5 then value.format.. which do not work for showing a formatted time.
Does anyone have method of rendering a timefield in a grid which allows formatting the time and editing?
initially I was using renderer: Ext.util.Format.dateRenderer('H:i:s') which displayed the time as
I wanted - but any edits caused a NaN. Following the existing forum posts I swiched to
a custom renderer which did nothing (except I'm guessing cast from string to date) and it did
make the editing functional - however the display when not editing is now the full date string.
var timeEditor = new fm.TimeField({format:'H:i:s', minValue: '0:01 AM', maxValue: '4:00 AM', increment: 1});
function renderTime(value){
return value;
};
{header: 'Start',width: 180,dataIndex: 'start_time', editor: timeEditor, renderer: renderTime},
{header: 'End',width: 180,dataIndex: 'end_time',editor: timeEditor, renderer: renderTime},
I've seen (and tried) various renderTime workaround examples like if value.length== 5 then value.format.. which do not work for showing a formatted time.
Does anyone have method of rendering a timefield in a grid which allows formatting the time and editing?