jQWidgets Forums

jQuery UI Widgets Forums Grid Change language in DateTimeInput column

This topic contains 2 replies, has 2 voices, and was last updated by  rdatilio 12 years, 10 months ago.

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

  • rdatilio
    Participant

    Hello,

    I’m using columntype “datetimeinput” and to change the language to “pt-BR” used localizestrings. In any grid language “pt-BR” is applied, but in the calendar of column “datetimeinput” English remains the language. What should I do to also change the language of the calendar?

    Thanks in advanced


    Peter Stoev
    Keymaster

    Hi rdatilio,

    You can take a look at this demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdatetimeinput/localization.htm?classic. It shows how to apply localization to a jqxDateTimeInput widget.

    Here’s a sample code which applies a localization for the jqxDateTimeInput widget in jqxGrid.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.edit.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/globalization/jquery.global.js"></script>
    <script type="text/javascript" src="../../jqwidgets/globalization/jquery.glob.cs-CZ.js"></script>
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="generatedata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getTheme();
    // prepare the data
    var data = generatedata(200);
    var source =
    {
    localdata: data,
    datatype: "array",
    updaterow: function (rowid, rowdata) {
    // synchronize with the server - send update command
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // initialize jqxGrid
    $("#jqxgrid").jqxGrid(
    {
    width: 400,
    source: dataAdapter,
    editable: true,
    theme: theme,
    selectionmode: 'singlecell',
    columns: [
    { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 },
    { text: 'Ship Date', datafield: 'date', columntype: 'datetimeinput', cellsalign: 'right', cellsformat: 'd',
    createeditor: function (row, column, editor) {
    editor.jqxDateTimeInput({ culture: 'cs-CZ' });
    }
    }
    ]
    });
    });
    </script>
    </head>
    <body class='default'>
    <div id="jqxgrid">
    </div>
    </body>
    </html>

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    rdatilio
    Participant

    It’s works Peter. Thanks !

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

You must be logged in to reply to this topic.