jQWidgets Forums

jQuery UI Widgets Forums Grid Date not displaying correctly after upgrade

This topic contains 5 replies, has 2 voices, and was last updated by  mr_putersmit 8 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • mr_putersmit
    Participant

    Hi
    I recently upgraded to jqxwidgets v4.2.1 and cannot get date to show as dd/MM/yyyy. It is displaying as Thu Aug 25 2016 11:29:18 GMT+0100 (GMT Standard Time). In previous version, (v3.4.0), this was not the case and displayed correctly. I am using renderer: columnrenderer, cellsrenderer: cellsrenderer to layout the data and this seems to be causing the problem. If I remove this, it displays correctly but loses formatting in that column. I have posted the code I am using and would be grateful if someone could show me a way round this. The reason I upgraded was because of the addition of the excel and pdf export functions.

    Thank you.

    jQuery: 1.11.0
    jqxwidgets v4.2.1

    PS: I have only posted the relevant code but if any additional info is needed, I shall be glad to post.

    datafields: [
    					 { name: 'id', type: 'string'},
    					 { name: 'date', type: 'date', format: 'd'},
    					 { name: 'activity', type: 'string'},
    					 { name: 'service', type: 'string'},
    					 { name: 'user', type: 'string'},
    					 { name: 'item', type: 'string'}
                    ]
    
    var dataAdapter = new $.jqx.dataAdapter(source);
                var editrow = -1;
    			var cellsrenderer = function (row, column, value) {
                    return '<div style="text-align: left; margin-top: 7px; margin-left: 6px;">' + value + '</div>';
                }
                var columnrenderer = function (value) {
                    return '<div style="text-align: left; margin-top: 7px; margin-left: 6px;">' + value + '</div>';
                }
    
    { text: 'Retrieval Date', editable: false, datafield: 'date', columntype: 'date', cellsformat: 'dd/MM/yyyy HH:mm:ss', renderer: columnrenderer, cellsrenderer: cellsrenderer, filtertype: 'date', width: 220},

    Peter Stoev
    Keymaster

    Hi mr_putersmit,

    Custom Render functions override built-in rendering. If you want to use custom render functions, you will have to wring own Date formatting logic.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    mr_putersmit
    Participant

    Hi Peter

    Thanks for swift reply. The problem is that the built-in rendering in vv4.2.1 puts all the text to the left with no left margin so it is touching the border. Is there a way to create some css such as margin-left: 8px; and apply to the cells. Hope so. Thanks


    mr_putersmit
    Participant

    Applied a rather crude temp css fix for now. Many thanks


    Peter Stoev
    Keymaster

    Hi mr_putersmit,

    Actually, you probably missed to update the CSS files when you upgraded, because there is default 4px left margin.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    mr_putersmit
    Participant

    Thanks Peter. Will check it out. I did initialy check the css files and could find no ref to .jqx-grid-cell-left-align.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.