jQuery UI Widgets Forums Grid date column from timestamp source

This topic contains 3 replies, has 2 voices, and was last updated by  pedro_prt 8 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • date column from timestamp source #74236

    pedro_prt
    Participant

    Hi

    Is it possible to display a column like ‘dd/MM/yy’ if I have the source in timestamp ?
    How should I configure de source type ? And the column properties ?

    Tks

    Pedro Oliveira

    date column from timestamp source #74245

    Dimitar
    Participant

    Hi Pedro Oliveira,

    Please specify the datafield’s type as ‘date’ and set the date column’s cellsformat property to ‘dd/MM/yy’.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    date column from timestamp source #74267

    pedro_prt
    Participant

    Hi Dimitar

    I allways get ’17/01/70′ on the date (data_vcto) column.
    My data has values like ‘1441166400’ (2015-09-02)

    Grid create function
    function grid_502_cpacre_cria(){
    $(“#div_502_grid_cpacre”).jqxGrid({
    width: 688, height: 360, columnsresize: true, rowsheight: 21, selectionmode: ‘multiplerows’, enablehover: true, sortable: true,
    localization: {decimalseparator: “,”, thousandsseparator:”.”, emptydatastring: “”}, theme: ‘energyblue’, scrollbarsize: 12,
    columns: [
    {text: ‘Cdg’, datafield: ‘cdg_f_parcelas’, width:40, type: ‘float’ },
    {text: ‘Data Vcto.’, datafield: ‘data_vcto’, width: ’90px’, cellsformat: ‘dd/MM/yy’},
    {text: ‘Conta’, datafield: ‘nome_konta’, width: ‘240px’},
    {text: ‘P/R’, datafield: ‘tipo’, width: ’80px’},
    {text: ‘Valor’, datafield: ‘valor’, width: ‘100px’, cellsalign: ‘right’, cellsformat: ‘d2’}

    ]
    });
    }

    Grid Update function
    function fn_grid_502_cpacre_atualiza(result){
    if(result.info[0].registros > 0){
    var dados = result.dados;
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘data_vcto’, type:’date’},
    { name: ‘valor’ },
    { name: ‘saldo’ },
    { name: ‘nome_konta’},
    { name: ‘num_parcela’},
    { name: ‘cdg_f_cpacre’ },
    { name: ‘cdg_f_parcelas’, type: ‘number’ },
    { name: ‘tipo’ },
    { name: ‘valor_baixas’ },
    { name: ‘qtd_baixas’ }
    ],
    localdata: dados
    };

    var dataAdapter = new $.jqx.dataAdapter(source);
    $(‘#div_502_grid_cpacre’).jqxGrid({source: dataAdapter});

    }
    }

    Tks
    Pedro Oliveira

    date column from timestamp source #74277

    pedro_prt
    Participant

    Hi Dimitar

    Sorry for keep on this topic, but I think it’s important for other users.
    I changed timestamp in seconds to miliseconds and it worked

    Tks

    Pedro Oliveira

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

You must be logged in to reply to this topic.