jQWidgets Forums

jQuery UI Widgets Forums Editors DateTimeInput JqxDateTimeinput with Jqxgrid-Culture not getting applied

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 7 months ago.

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

  • chandan
    Participant

    Hi,

    Culture(say Thailand) is not getting applied when edit the jqxdatetimeinput in jqxgrid(When cell is having a date initialized).
    Grid cell shows proper cultured date on grid-load.
    When we click on the cell to edit it, then cell became editable and it showed date with out culture.
    But the calender properly shows culture and if we select a date from the calender, cell show expected date(cultured).

    Please find specific column (code snap) used for development:-

    text: 'Start Date', columntype: 'datetimeinput', datafield: 'StartDate', width: '9%', minwidth: 90, align: 'left', cellsalign: 'left', cellsformat: 'd', clearString: "Clear", showFooter: true,cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties){
                          return Globalize.format(value, 'd', "th-TH");                                          
                          },                      
                          createeditor: function (row, column,<code></code> editor) {
                              editor.jqxDateTimeInput({ firstDayOfWeek: _firstDayOfWeek, culture: "th-TH" });
                          }
                      }

    Could you please help us on this?


    Peter Stoev
    Keymaster

    Hello chandan,

    I’d suggest you to check out the Grid’s localization help topic and example. Localization of the Grid and its editors is done by the Grid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    chandan
    Participant

    Hi,

    I have used Grid localization but still edited cell is showing date 31/10/2014 but it should be 31/10/2557(Thailand culture).
    I used the jsfiddle to replicate issue(http://jsfiddle.net/q3BPu/13/).

    following code is used to set the year offset:-
    `var allEra = {
    eras: [{ “name”: “A.D.”, “start”: null, “offset”: -543 }]
    }
    localizationobj.eras = allEra;`

    Could you please check the problem?


    Peter Stoev
    Keymaster

    Hi chandan,

    We do not take into account in our calculations the “offset” setting of the “era”. If you need that, I would suggest you to implement the column’s cellsrenderer callback function.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    chandan
    Participant

    Hi,
    I have already applied cellsrender in ‘datetimeinput’ column as follows:-
    `cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
    var formattedDate = Globalize.format(value, ‘d’, “TH-th”);
    return ‘<div style=”text-align: center; margin-top: 5px;”>’ + formattedDate + ‘</div>’;
    },
    It showing date correctly while cell is not editable but when it became editable it shows date again with out year ‘offset'(-543).

    Please provide some suggestion on this problem


    Peter Stoev
    Keymaster

    Hi chandan,

    In the Grid column’s “initeditor” you can customize the editor’s value and representation as well.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.