开发者

ExtJS strange dateTimeField value in POST

开发者 https://www.devze.com 2023-03-29 13:28 出处:网络
I am using ExtJS version 3.0.0 and I really don\'t know why every time I submit a form with a datefield, the date is send to POST like this: Y-7-31 0:i:0 . I have not extended/modified the datefield c

I am using ExtJS version 3.0.0 and I really don't know why every time I submit a form with a datefield, the date is send to POST like this: Y-7-31 0:i:0 . I have not extended/modified the datefield code, anybody else encountered this problem ?

EDIT: I am actually using the datetimefield extension (found here) and the config is this:

{
                 xtype:'xdatetime'
              开发者_高级运维  ,id:'date_edit_task'
                ,name: 'data'
                ,fieldLabel:'Insert date and time'
                ,anchor:'-18'
                ,timeFormat:'H:i:s'
                ,timeConfig: {
                altFormats:'H:i:s'
                ,allowBlank:true    
                }
                ,dateFormat:'d-m-Y'
                ,dateConfig: {
                altFormats:'Y-m-d|Y-n-d'
                ,editable: false
                ,allowBlank:true    
                }
            }

I have also read the forum pages of this extension and noticed another guy having the same problem, here is the link to his post: same problem link . Over there, Jsakalos asks about hiddenFormat config. Mine is hiddenFormat:'Y-m-d H:i:s'.

Any ideas ?

Thanks.


If you have the ability to upgrade to ExtJS 3.3.x, then you could just switch to a compositeField instead of using this user extension. Something like:

{
    xtype: 'compositefield',
    fieldLabel: 'Date/Time',
    labelWidth: 120
    items: [
    {
        xtype     : 'datefield',
        name      : 'xdate'
    },
    {
        xtype     : 'timefield',
        name      : 'xtime'
    }]
}
0

精彩评论

暂无评论...
验证码 换一张
取 消