Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Sep 2013
    Location
    Cuba
    Posts
    26
    Vote Rating
    2
    Neopulse is on a distinguished road

      0  

    Default About datecolumn

    About datecolumn


    I have been stuck for a couple of weeks in this, my grid doesn't show dates in firefox, but it´s show as I want in chrome.

    I have read about 20 post about the issue and try every single advice but nothing, did anyone can explain the best way to store, retrieve dates from a mysql database and show in a grid. I have try everything since say the datatype in the model, the same in the datetype of the column, and noting.
    check this please
    Code:
    Ext.define('ControLab.model.modVisita', {
    	extend: 'Ext.data.Model',
    
    
    	fields: [
    	{
    		name: 'entrada',
    		type: 'date',
    		dateformat: 'Y-m-d H:i:s',
    	},
    ......
    }
    later the grid
    Code:
    Ext.define('ControLab.view.gridVisita', {
    	extend: 'Ext.grid.Panel',
    	alias: 'widget.gridVisita',
    	store: 'storeVisita',
    ....
    columns: [
      {
       xtype: 'datecolumn',
       dataIndex: 'entrada',
       text: 'Entrada',
      //renderer:  Ext.util.Format.dateRenderer('d/m/Y h:i'),
      //format: 'd/m/Y H:i:s',
      dateformat: 'Y-m-d H:i:s',
      //submitFormat:'U',
      width: 200,
      allowBlank:false,			
     },
    ...
     ]
    }

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,925
    Vote Rating
    634
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    What does your server send back?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Sep 2013
    Location
    Cuba
    Posts
    26
    Vote Rating
    2
    Neopulse is on a distinguished road

      0  

    Default data send

    data send


    The server send back
    {"success":true,"total":3,"visitas":[{"idvisita":"239","idusuario":"116","ci":"12345678908","entrada":"2013-11-25 17:30:46","salida":"0000-00-00 00:00:00","nombre":"\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1a\u00e1\u00e1\u00b4\u00f1\u00f1\u00f1","pcname":"PC-1","idoperador":"5","visitNotas":"","idpc":"1"},{"idvisita":"249","idusuario":"112","ci":"3.534543534","entrada":"2013-11-25 10:19:27","salida":"0000-00-00 00:00:00","nombre":"\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1a\u00e9\u00e9e\u00b4\u00b4e\u00e9\u00e9\u00e9\u00e9","pcname":"PC-2","idoperador":"5","visitNotas":"","idpc":"2"},{"idvisita":"250","idusuario":"113","ci":"22323423423","entrada":"2013-11-25 10:19:45","salida":"0000-00-00 00:00:00","nombre":"dfgdfgdfgdfgdfgdfgdfg","pcname":"PC-3","idoperador":"5","visitNotas":"","idpc":"5"}]}
    The dates are in "Y-m-d H:i:s" format as you can see
    2013-11-25 17:30:46

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,007
    Vote Rating
    458
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Are you seeing a bunch of NaN in FF?

    Selection_488.png

  5. #5
    Sencha User
    Join Date
    Sep 2013
    Location
    Cuba
    Posts
    26
    Vote Rating
    2
    Neopulse is on a distinguished road

      0  

    Default FF show empty column

    FF show empty column


    Firefox show the column empty, at first it show that NAN/NaN/0NaN
    just like


    But after digging in the forum and the extens API I set the appropriated (I thought) config
    Code:
    Ext.define('ControLab.model.modVisita', {
        extend: 'Ext.data.Model',
        fields: [
                   {
                name: 'entrada',
                type: 'date',
                dateformat: 'Y-m-d H:i:s',
            },
    //more fields
                 ]
    });
    And then those NAN/NaN/0NaN disappear but the grid show nothing as you can see here
    ff-now.gif

    The weird thing here is the fact that Chrome v25.0 (not the last) show the dates as I like
    crome.gif

    even I can change the date format
    Code:
        renderer:  Ext.util.Format.dateRenderer('d M Y - h:i a'),
    and show a different format (but unfortunately in chrome only) like you can see
    crome1.gif
    Any ideas please??
    Excuse my English please

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,007
    Vote Rating
    458
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    yes, it will show blank if you use date instead of datetime
    { name: 'stamp', type: 'datetime', dateFormat : 'Y-m-d H:i' }

    But it then shows the NaN .. I suspect this is a parsing bug with FF (same type of report for charting a while back)

  7. #7
    Sencha User
    Join Date
    Sep 2013
    Location
    Cuba
    Posts
    26
    Vote Rating
    2
    Neopulse is on a distinguished road

      0  

    Default my last shot

    my last shot


    I even try a different approach (it was my last shot). I made a modification in my SQL query to ensure to get the appropriated format, look the red letter
    Code:
    try {
    		$v_consulta = $db_conn->query('SELECT 
    			`visitas`.id AS idvisita, `visitas`.`idusuario`,`usuarios`.`ci`, DATE_FORMAT(`visitas`.entrada,"%Y-%m-%d %H:%i:%s") AS entrada, `visitas`.salida,
    			`usuarios`.`nombre`,`pc`.`nombre` AS pcname,
    			`visitas`.operador AS idoperador,  `visitas`.notas as visitNotas,  `visitas`.idpc
    			FROM visitas
    			LEFT JOIN `controlab`.`usuarios` ON `visitas`.`idusuario` = `usuarios`.`id` 
    			LEFT JOIN `controlab`.`pc` ON `visitas`.`idpc` = `pc`.`id`
    			WHERE `visitas`.`salida` = "0000-00-00 00:00:00"
    			ORDER BY  `visitas`.`idpc` 
    			');
    Then I delete any other custom component
    Code:
    /*{  xtype: 'buttoncolumn',
      width: 120,
      text: 'Acciones',
    ...
    }*/
    and

    Code:
    /*editor: {	
    	xtype: 'datetimefield',
    	format: 'd/m/Y',
    	submitFormat:'U',
    	listeners:{
    	    focus:function(me, evt){
    	        var valor = new Date(me.up().startValue);
    	        me.setValue(valor);
    	    }
    	},
    },*/
    and

    <!-- <script src="resources/js/ButtonColumn.js"></script>
    <script type="text/javascript" src="resources/js/UX_TimePickerField.js"></script>
    <script type="text/javascript" src="resources/js/UX_DateTimePicker.js"></script>
    <script type="text/javascript" src="resources/js/UX_DateTimeField.js"></script>
    <script type="text/javascript" src="resources/js/UX_DateTimeMenu.js"></script>-->
    I thought "may be one of theses components, overwrite the date parse mechanism of the extens core" that make FF get lost and Chrome get unaffected for some reason, but.... nothing.

    I´m really lost here

  8. #8
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,007
    Vote Rating
    458
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,925
    Vote Rating
    634
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    This isn't a bug.

    Your date format is:

    Code:
    Y-m-d H:i:s
    Your date is:

    Code:
    2013-02-20 07:03
    You're not sending back any seconds. Modify the format so it matches what your server is sending.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  10. #10
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,007
    Vote Rating
    458
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Errr, Evan is correct, .. I guess I pulled 'datetime' type out of my ...

    See if this will work for you, tested fine in FF


Thread Participants: 3

Tags for this Thread