jQWidgets Forums

jQuery UI Widgets Forums Grid Grid localization issue

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Grid localization issue #59774

    DaTe
    Participant

    Hi,

    there is an issue when the decimal and thousand separator are localized. Please find below the code. If you try to insert in the “qt.” field a value like 123,45 the cell will be rendered as 123..45 !

    Here is the code:

    
    var data = generatedata(250);
     var source = {
         localdata: data,
         datafields: [{
             name: 'name',
             type: 'string'
         }, {
             name: 'productname',
             type: 'string'
         }, {
             name: 'available',
             type: 'bool'
         }, {
             name: 'date',
             type: 'date'
         }, {
             name: 'quantity',
             type: 'number'
         }, {
             name: 'price',
             type: 'number'
         }],
         datatype: "array"
     };
     var dataAdapter = new $.jqx.dataAdapter(source);
     var getLocalization = function () {
         var localizationobj = {};
         localizationobj.pagergotopagestring = "Gehe zu:";
         localizationobj.pagershowrowsstring = "Zeige Zeile:";
         localizationobj.pagerrangestring = " von ";
         localizationobj.pagernextbuttonstring = "voriger";
         localizationobj.pagerpreviousbuttonstring = "nächster";
         localizationobj.sortascendingstring = "Sortiere aufsteigend";
         localizationobj.sortdescendingstring = "Sortiere absteigend";
         localizationobj.sortremovestring = "Entferne Sortierung";
         localizationobj.firstDay = 1;
         localizationobj.percentsymbol = "%";
         localizationobj.currencysymbol = "€";
         localizationobj.currencysymbolposition = "after";
         localizationobj.decimalseparator = ",";
         localizationobj.thousandsseparator = ".";
         var days = {
             // full day names
             names: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
             // abbreviated day names
             namesAbbr: ["Sonn", "Mon", "Dien", "Mitt", "Donn", "Fre", "Sams"],
             // shortest day names
             namesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
         };
         localizationobj.days = days;
         var months = {
             // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
             names: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""],
             // abbreviated month names
             namesAbbr: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez", ""]
         };
         var patterns = {
             d: "dd.MM.yyyy",
             D: "dddd, d. MMMM yyyy",
             t: "HH:mm",
             T: "HH:mm:ss",
             f: "dddd, d. MMMM yyyy HH:mm",
             F: "dddd, d. MMMM yyyy HH:mm:ss",
             M: "dd MMMM",
             Y: "MMMM yyyy"
         }
         localizationobj.patterns = patterns;
         localizationobj.months = months;
         localizationobj.todaystring = "Heute";
         localizationobj.clearstring = "Löschen";
         return localizationobj;
     }
     $("#jqxgrid").jqxGrid({
         width: 700,
         source: dataAdapter,
         showfilterrow: true,
         filterable: true,
         pageable: true,
         autoheight: true,
         editable: true,
         localization: getLocalization(),
         selectionmode: 'singlecell',
         columns: [{
             text: 'Name',
             columntype: 'textbox',
             filtertype: 'textbox',
             datafield: 'name',
             width: 115
         }, {
             text: 'Produkt',
             filtertype: 'textbox',
             datafield: 'productname',
             width: 220
         }, {
             text: 'Datum',
             datafield: 'date',
             columntype: 'datetimeinput',
             filtertype: 'date',
             width: 210,
             cellsalign: 'right',
             cellsformat: 'd'
         }, {
             text: 'Qt.',
             datafield: 'quantity',
             cellsformat: "f",
             //columntype: 'numberinput',
             //filtertype: 'textbox',
             //cellsalign: 'right',
             width: 100
         }, {
             text: 'Preis',
             datafield: 'price',
             columntype: 'numberinput',
             filtertype: 'textbox',
             cellsformat: "c2",
             cellsalign: 'right'
         }]
     });
    

    Regards,

    DaTe

    Grid localization issue #59797

    Peter Stoev
    Keymaster

    Hi DaTe,

    You can use “f2” format as a solution, insted of “f” format.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.