Results 1 to 6 of 6

Thread: [solved] TimeField in EditorGridPanel returns empty value

  1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    32

    Thumbs up [solved] TimeField in EditorGridPanel returns empty value

    I am using Ext 3.0 RC2. In my EditorGridPanel I have a TimeField as editor.

    If I select a value and click outside the TimeField it returns a empty value into the grid.

    It works fine if I select a value and press enter. I added some logging but I am not sure how to handle this problem.

    I think the problem appeared with the update to Ext 3 from Ext 2.2 but I am not sure.
    The following code is a reduced version. I hope I didn't cut out something important.

    Code:
        var Eintrag = Ext.data.Record.create([
                {name: 'localFrom'}
        ]);
        var store = new Ext.data.Store({
            url: '/gethours',
            reader: new Ext.data.JsonReader({
                root: 'rows',
                id: 'id'
            },Eintrag)
        });
        function rndTime(val){
            return val;
        }
        var gridPanel = new Ext.grid.EditorGridPanel({
            id: 'gridPanel',
            renderTo: Ext.get('gridDiv'),
            store: store,
            border: false,
            autoHeight: true,
            stripeRows: true,
            clicksToEdit: 1,
            viewConfig:{
                forceFit: true
            },
            columns: [
                {
                    id: 'localFrom',
                    header: '<?= $this->translate('Von') ?>',
                    dataIndex: 'localFrom',
                    sortable: true,
                    renderer: rndTime,
                    editor: new Ext.form.TimeField({
                        format:'H:i:s',
                        allowBlank:false,
                        listeners: {select: function(){
                            console.log(this.getValue()); // value as expected
                        }, blur: function(){
                            console.log(this.getValue()); // empty
                        }},
                        increment:15})
                }
            ]
        });
    Thanks for your time!
    Greetings Philipp

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    32

    Default

    Dirty workaround...

    Code:
    var timeHack;
    // ...
                    editor: new Ext.form.TimeField({
                        format:'H:i:s',
                        allowBlank:false,
                        listeners: {select: function(){
                            timeHack = this.getValue();
                        }, blur: function(){
                            this.setValue(timeHack);
                        }, show: function(){
                            timeHack = this.getValue();
                        }},
    // ...

  3. #3
    Sencha User
    Join Date
    Nov 2008
    Posts
    13

    Default It is a bug !

    I have the same problem after I upgraded my code from Ext 2.2.1 to Ext 3.0 rc2

    If you select time and click with mouse outside timefield menu - the menu get blank, so you loose your time value. Using the dirty hack at the moment which is not very good programming style

  4. #4
    Sencha User
    Join Date
    Dec 2008
    Location
    Lodz, Poland
    Posts
    173

    Default

    I have the same problem, have you reported it on Ext 3.0 bugs (sub)forum? It's definitely the bug in 3.0.RC2, it worked in 2.2.1.
    In my case I use GridPanel with RowEditor, but the effect is the same.

  5. #5
    Sencha User
    Join Date
    Dec 2008
    Location
    Lodz, Poland
    Posts
    173

    Default

    Ok I found, it's already reported: http://extjs.com/forum/showthread.php?t=70210

  6. #6
    Sencha User
    Join Date
    Jun 2009
    Posts
    32

    Thumbs up

    Thanks, this solves the problem for me:
    http://extjs.com/forum/showthread.ph...926#post339926

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •