1. #11
    Ext User mirage's Avatar
    Join Date
    Apr 2007
    Location
    Wisconsin, USA
    Posts
    114
    Vote Rating
    0
    mirage is on a distinguished road

      0  

    Default


    Ok Saki - thanks!

    This gets rid of the errors. But now, clicking the trigger shows the calendar with today's date rather than date in the field. Any ideas?

  2. #12
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    I've tested it and I haven't found any problem. One thing that comes to my mind is that if you setValue of the field in the form of 'yyyy-mm-dd hh:mm: ss" it resets itself tu empty value because 'Y-m-d H:i: s' is not in altFormats by default.

    You can either add that format or you can strip time from value you wanna set. Keep in mind, it is XDateField and it behaves 99.99% same as it's parent DateField.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #13
    Ext User mirage's Avatar
    Join Date
    Apr 2007
    Location
    Wisconsin, USA
    Posts
    114
    Vote Rating
    0
    mirage is on a distinguished road

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    I've tested it and I haven't found any problem. One thing that comes to my mind is that if you setValue of the field in the form of 'yyyy-mm-dd hh:mm: ss" it resets itself tu empty value because 'Y-m-d H:i: s' is not in altFormats by default.

    You can either add that format or you can strip time from value you wanna set. Keep in mind, it is XDateField and it behaves 99.99% same as it's parent DateField.
    Hi Saki -

    I do setValue on the field. And I've also added 'Y-m-d H:i' to altFormats upon field creation. So that's apparently not it. I'll keep poking. I agree that your extension is very straightfoward and doesn't do much altering. Still odd that I'm not getting same results as with DateField. All I do is switch out the xType.

    With DateField, I don't get my formatted submit value, with xdatefield my calendar's not working. Podo!!! :-)

    Perhaps I'll just have to go with stripping the time.

  4. #14
    Ext User mirage's Avatar
    Join Date
    Apr 2007
    Location
    Wisconsin, USA
    Posts
    114
    Vote Rating
    0
    mirage is on a distinguished road

      0  

    Default


    Saki -

    I've updated to Ext 2.0.2 and pasted back your original code. It's all working now. Guess something little must've changed in the bowels of Ext.

    Cheers,
    Juergen

  5. #15
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Try the following code. The XDateField accepts also Y-m-d H:i format.

    PHP Code:
    <html>
    <
    head>
        <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <
    link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css">
        <
    script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="../ext/ext-all-debug.js"></script>
        <script type="text/javascript" src="../js/Ext.ux.form.XDateField.js"></script>
        <script type="text/javascript">

    Ext.BLANK_IMAGE_URL = '../ext/resources/images/default/s.gif';
    Ext.onReady(function() {
        Ext.QuickTips.init();
        Ext.form.Field.prototype.msgTarget = 'side';
        var win = new Ext.Window({
             width:500
            ,id:'winid'
            ,height:300
            ,layout:'fit'
            ,border:false
            ,closable:false
            ,title:'Ext.ux.form.DateTime Example'
            ,items:[{
                 xtype:'form'
                ,frame:true
                ,labelWidth:100
                ,id:'form'
                ,url:'.'
                ,items:[{
                     xtype:'xdatefield'
                    ,fieldLabel:'XDateField'
                    ,id:'xdf'
                    ,altFormats:"Y-m-d H:i:s|m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|"
                }]
            }]
            ,buttons:[{
                 text:'Submit'
                ,handler:function() {
                    Ext.getCmp('form').getForm().submit();
                }
            }]
        });
        win.show();
    });
        </script>
        <title>Ext.ux.form.XDateField Example</title>
    </head>
    <body>
    </body>
    </html> 
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  6. #16
    Ext User
    Join Date
    Nov 2007
    Posts
    4
    Vote Rating
    0
    michele.rota is on a distinguished road

      0  

    Default onLoad form: xdatefield doesn't fill on IE

    onLoad form: xdatefield doesn't fill on IE


    Hi,

    I can't figure out how can I make work the xdatefield in Internet Explorer (6 & 7).
    Populating the form with a datastore, the xdatefield works perfectly on Firefox, but it doesn't show anything on IE.

    Commenting "this.el.dom.name = null" the form fills perfectly, but obviously if I send the form, the field is sent twice.

    Thanks in advance

  7. #17
    Ext User mirage's Avatar
    Join Date
    Apr 2007
    Location
    Wisconsin, USA
    Posts
    114
    Vote Rating
    0
    mirage is on a distinguished road

      0  

    Exclamation


    Quote Originally Posted by michele.rota View Post
    Hi,

    I can't figure out how can I make work the xdatefield in Internet Explorer (6 & 7).
    Populating the form with a datastore, the xdatefield works perfectly on Firefox, but it doesn't show anything on IE.

    Commenting "this.el.dom.name = null" the form fills perfectly, but obviously if I send the form, the field is sent twice.

    Thanks in advance
    Hi, I haven't looked into this in detail - but I'm experiencing the exact same problem. Glad I'm not the only one. xDateField seems fine on FF, Safari but not in IE6/7. Hopefully Saki can figure it out.

    Here's how I use it:

    Code:
    // predefined somewhere
    var cnsAltFormats = 'm/d/Y|m-d-y|m-d-Y|m/d|m-d|d|Y-m-d H:i:s|n/j/Y|n/j/y|n/j|m/j/Y|m/j/y|m/j|n/d/Y|n/d/y|n/d|j';
    
    // then as part of a forms item config
    {xtype:'xdatefield', fieldLabel: 'Date of Birth', name: 'dateofbirth', anchor: '45%', submitFormat: 'Y-m-d H:i:s', format:'m/d/Y', altFormats: cnsAltFormats},
    Thanks,
    Juergen

  8. #18
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Quote Originally Posted by michele.rota View Post
    Hi,

    I can't figure out how can I make work the xdatefield in Internet Explorer (6 & 7).
    Populating the form with a datastore, the xdatefield works perfectly on Firefox, but it doesn't show anything on IE.

    Commenting "this.el.dom.name = null" the form fills perfectly, but obviously if I send the form, the field is sent twice.

    Thanks in advance
    True is that I haven't tested the field in IE as I 1) don't use Micro$oft "products" and 2) I force my users to use Firefox. Should you find a workaround I'll be happy to include it in the code.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  9. #19
    Ext User mirage's Avatar
    Join Date
    Apr 2007
    Location
    Wisconsin, USA
    Posts
    114
    Vote Rating
    0
    mirage is on a distinguished road

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    True is that I haven't tested the field in IE as I 1) don't use Micro$oft "products" and 2) I force my users to use Firefox. Should you find a workaround I'll be happy to include it in the code.
    You're one lucky guy Saki. As this is an extension of the DateField, shouldn't one assume that there is a bigger problem here with Extending Ext [form] components? I don't see the code doing anything extremely overriding as far as rendering is concerned...

    Juergen

  10. #20
    Ext User
    Join Date
    Nov 2007
    Posts
    4
    Vote Rating
    0
    michele.rota is on a distinguished road

      0  

    Default Solved!

    Solved!


    Hey,

    I temporarily solved the problem forcing the field id the same as the field name.

    Code:
    {
                xtype: "xdatefield",
    	    format: 'd/m/Y',
                fieldLabel: 'Data scadenza',
                name: 'data_scadenza',
    	   id: "data_scadenza"
            }