Page 3 of 84 FirstFirst 123451353 ... LastLast
Results 21 to 30 of 837

Thread: [new version] DateTime Field

  1. #21
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Quote Originally Posted by wenner View Post
    i try the code
    Code:
    Ext.getCmp('form').getForm().reset()
    getValues is NaN , the field show "NaN.NaN.NaN"
    Thanks for bug report. It's fixed now.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  2. #22
    Sencha User
    Join Date
    Apr 2007
    Posts
    10
    Vote Rating
    0
      0  

    Default

    bug:
    1. Focus the field but don't select , then click 'submit' , getvalue() is empty "" -- only IE
    2. click 'submit' again , alert "NaN.NaN.NaN NaN:NaN:NaN" -- IE6 && FF2

    and i use the new script of the top post.....

    how fix?

  3. #23
    Ext User acontreras's Avatar
    Join Date
    Dec 2007
    Posts
    40
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by jsakalos View Post
    It was easier that I'd thought. Get the code from the first post now and give it a try.

    Nice, now it's validating.

    Thanks!

  4. #24
    Ext User daviscabral's Avatar
    Join Date
    May 2007
    Location
    Cascavel / PR / Brazil
    Posts
    45
    Vote Rating
    0
      0  

    Default

    On focus/blur this happens:
    Code:
    elp has no properties
    this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}...

  5. #25
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Quote Originally Posted by daviscabral View Post
    On focus/blur this happens:
    Code:
    elp has no properties
    this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}...
    Post your code. Never happened to me.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  6. #26
    Ext User daviscabral's Avatar
    Join Date
    May 2007
    Location
    Cascavel / PR / Brazil
    Posts
    45
    Vote Rating
    0
      0  

    Default

    Follow:
    Code:
    DadosVisita: function() {
            var dialog = Ext.WindowMgr.getActive();
    		var dsProspectsTiposContatos = Ext.StoreMgr.get("dsProspectsTiposContatos");
    		if ( !dsProspectsTiposContatos ) {        
    			var dsProspectsTiposContatos = new Ext.data.Store({
    				proxy: new Ext.data.HttpProxy({url: "../ProspectsTiposContatos/Index.ashx"}),
    				reader: new Ext.data.JsonReader({root: 'Results',totalProperty: 'totalItems'}, [
    					{name: 'Id'},
    					{name: 'Descricao'}
    				])
    			});					
    			dsProspectsTiposContatos.load({params: {sort:"Descricao",start:0,limit:9999,dir:"ASC",combobox: true}});
    			Ext.StoreMgr.add("dsProspectsTiposContatos", dsProspectsTiposContatos);
    		}
            return {
                id: dialog.id+'_Visitas',
                title:'Dados da visita',
                layout:'form',
                labelWidth: 120,
                bodyStyle:'padding:10px',
                border:false,
                closable:true,
                items:[{
                    xtype: 'reloadcombobox',
                    fieldLabel:'Tipo',
                    hiddenName:'ProspectContato.ProspectTipoContato.Id',
                    store:dsProspectsTiposContatos,
                    valueField:'Id',
                    displayField:'Descricao',
                    forceSelection:true,
                    typeAhead:true,
                    mode:'local',
                    selectOnFocus:true,
                    width: '94%',
                    allowBlank:false
                },{
                    xtype: 'xdatetime',
                    fieldLabel:'Data',
                    id:dialog.id+'_Data',
                    name:'ProspectContato.Data',
                    forceSelection:true,
                    typeAhead:true,
                    anchor:'94%',
                    timeFormat:'H:i:s',
                    timeConfig: {
                        altFormats:'H:i:s',
                        allowBlank:false    
                    },
                    dateFormat:'d/m/Y',
                    dateConfig: {
                        altFormats:'Y-m-d|Y-n-d',
                        allowBlank:false    
                    }
                },{
                    xtype: 'textarea',
                    fieldLabel:'Resultado',
                    name:'ProspectContato.Resultado',
                    height: 160,
                    width: '90%',
                    allowBlank:false
                }]
            };        
        }
    Code:
    elp has no properties
    markInvalid("Este campo é obrigatório.")ext-all.js (line 25362)
    validateValue("")ext-all.js (line 25673)
    validateValue("")ext-all.js (line 26173)
    validate()ext-all.js (line 25319)
    onBlur()ext-customization... (line 271)
    triggerBlur()ext-all.js (line 25847)
    mimicBlur(Object browserEvent=Event mousedown button=0)ext-all.js (line 25835)
    h(Object browserEvent=Event mousedown button=0)ext-all.js (line 1629)
    (no name)()ext-all.js (line 1592)
    [Break on this error] this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}...
    The line red is here:
    Code:
    Ext.override(Ext.form.Field, {
        // private
        onBlur : function(){
            this.el.removeClass(this.focusClass);
            this.hasFocus = false;
            if (this.forceUpperCase) {
                this.el.dom.value = String(this.getValue()).toUpperCase();
            }
            if(this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur"){
                this.validate();
            }
            var v = this.getValue();
            if(v != this.startValue){
                this.fireEvent('change', this, v, this.startValue);
            }
            this.fireEvent("blur", this);
        }
    });
    Thanks!

  7. #27
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Hmmm,

    I don't have enough time to make your code runnable by putting it go a page. I meant a full runnable code that I can run, change and debug fast.

    Nevertheless, for the first glance, you override onBlur method of Ext.form.Field so I cannot help in that case as the problem lies most likely in your override.

    I use this field both in form and grid and it works flawlessly.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  8. #28
    Ext User daviscabral's Avatar
    Join Date
    May 2007
    Location
    Cascavel / PR / Brazil
    Posts
    45
    Vote Rating
    0
      0  

    Default

    I found the error:
    Code:
    Ext.form.Field.prototype.msgTarget = 'side';
    Code:
                case 'side':
                    if(!this.errorIcon){
                        var elp = this.el.findParent('.x-form-element', 5, true);
                        this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'});
                    }
                    this.alignErrorIcon();
                    this.errorIcon.dom.qtip = msg;
                    this.errorIcon.dom.qclass = 'x-form-invalid-tip';
                    this.errorIcon.show();
                    this.on('resize', this.alignErrorIcon, this);
                    break;

  9. #29
    Sencha User
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
      0  

    Default

    Great jsakalos
    I know many people were asking for this and I will definitively find a place for it in my current application

  10. #30
    Ext User
    Join Date
    Aug 2007
    Location
    beijing
    Posts
    30
    Vote Rating
    0
      0  

    Default

    It work fine on IE 7 . thanks.

Page 3 of 84 FirstFirst 123451353 ... LastLast

Posting Permissions

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