jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Localization
Tagged: datagrid, datagridview, grid, grid localization, gridview, jqxgrid
This topic contains 14 replies, has 3 voices, and was last updated by zibotaz 12 years, 11 months ago.
-
AuthorLocalization Posts
-
Hi,
at first, I have to say that jqwidgets is a very awesome framework. Good Work, really! (:
My Question: Is there an overview with localizations-strings in grids which I can set? (Reference)
Best Regards,
AdrianHi Adrian,
Here’s the full list of localization strings:
firstDay: 0,days: { // full day names names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // abbreviated day names namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // shortest day names namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]},months: { // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], // abbreviated month names namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""]},// AM and PM designators in one of these forms:// The usual view, and the upper and lower case versions// [standard,lowercase,uppercase]// The culture does not use AM or PM (likely all standard date formats use 24 hour time)// nullAM: ["AM", "am", "AM"],PM: ["PM", "pm", "PM"],eras: [// eras in reverse chronological order.// name: the name of the era in this culture (e.g. A.D., C.E.)// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.// offset: offset in years from gregorian calendar{"name": "A.D.", "start": null, "offset": 0 }],twoDigitYearMax: 2029,patterns: { // short date pattern d: "M/d/yyyy", // long date pattern D: "dddd, MMMM dd, yyyy", // short time pattern t: "h:mm tt", // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"},percentsymbol: "%",currencysymbol: "$",currencysymbolposition: "before",decimalseparator: '.',thousandsseparator: ',',pagergotopagestring: "Go to:",pagershowrowsstring: "Show rows:",pagerrangestring: " of ",pagerpreviousbuttonstring: "previous",pagernextbuttonstring: "next",groupsheaderstring: "Drag a column and drop it here to group by that column",sortascendingstring: "Sort Ascending",sortdescendingstring: "Sort Descending",sortremovestring: "Remove Sort",groupbystring: "Group By this column",groupremovestring: "Remove from groups",filterclearstring: "Clear",filterstring: "Filter",filtershowrowstring: "Show rows where:",filterorconditionstring: "Or",filterandconditionstring: "And",filterstringcomparisonoperators: ['empty', 'not empty', 'contains', 'contains(match case)', 'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)', 'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'],filternumericcomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'],filterdatecomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null']
This topic describes how to apply the strings: localization.htm
Best Regards,
Peter Stoevhttp://www.jqwidgets.com
jQWidgets TeamWhen i use this code with the 2.0 version :
$(“#jqxgrid”).bind(“bindingcomplete”, function (event) {
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”;
// apply localization.
$(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);
});line: 7
I have the javascript error : Impossible the value of the property « visiblerecords » : object null or undefinedAnd all the lines of my grid are empty.
Why ??
Steve
Hi Steve,
I’m afraid that I’m not sure what may be the cause for the behavior you have described. Therefore, providing a sample in which this can be observed locally will be appreciated. We currently have an Online Localization Demo which does exactly the same with version 2.0 so I guess there’s something else.
Looking forward for your sample.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello,
I have just added the code :
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”;
// apply localization.
$(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);in the function : $(“#jqxgrid”).bind(“bindingcomplete”, function() {
of the demo : nestedgrids.htmand i have :
the javascript error : (line: 7) Impossible the value of the property « visiblerecords » : object null or undefined
And all the lines of my grid are empty.
When i sort a column all the lines of my grid are complete.
Regards,
Steve
The same problem append with the demo file : rowdetails.htm
Steve
I’ve reproduced it in the nestedgrids demo. The issue occurs when the method is called and the data is still not loaded.
You can use this workaround:
$("#jqxgrid").bind('bindingcomplete', function () { var localizationobj = $("#jqxgrid").jqxGrid('gridlocalization'); 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"; // apply localization. $("#jqxgrid").jqxGrid('render');});
Best regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI’m sorry but your solution don’t run.
I’have no error but nothing appends all text stay in english.
Steve
Hi Steve,
Its my fault, I should have posted the full web page’s code:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="scripts/jqxcore.js"></script> <script type="text/javascript" src="scripts/jqxdata.js"></script> <script type="text/javascript" src="scripts/jqxbuttons.js"></script> <script type="text/javascript" src="scripts/jqxscrollbar.js"></script> <script type="text/javascript" src="scripts/jqxmenu.js"></script> <script type="text/javascript" src="scripts/jqxgrid.js"></script> <script type="text/javascript" src="scripts/jqxgrid.selection.js"></script> <script type="text/javascript" src="scripts/jqxgrid.columnsresize.js"></script> <script type="text/javascript" src="scripts/jqxlistbox.js"></script> <script type="text/javascript" src="scripts/jqxdropdownlist.js"></script> <script type="text/javascript" src="scripts/jqxgrid.pager.js"></script> <script type="text/javascript" src="scripts/jqxgrid.sort.js"></script> <script type="text/javascript"> $(document).ready(function () { // prepare the data var source = { datatype: "json", datafields: [ { name: 'name' }, { name: 'type' }, { name: 'calories', type: 'int' }, { name: 'totalfat' }, { name: 'protein' }, ], id: 'id', url: 'beverages.txt', async: false }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxgrid").bind('bindingcomplete', function() { var localizationobj = $("#jqxgrid").jqxGrid('gridlocalization'); 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"; // apply localization. $("#jqxgrid").jqxGrid('render'); }); $("#jqxgrid").jqxGrid( { source: dataAdapter, columnsresize: true, pageable: true, sortable: true, autoheight: true, columns: [ { text: 'Name', datafield: 'name', width: 250 }, { text: 'Beverage Type', datafield: 'type', width: 250 }, { text: 'Calories', datafield: 'calories', width: 180 }, { text: 'Total Fat', datafield: 'totalfat', width: 120 }, { text: 'Protein', datafield: 'protein', minwidth: 120 } ] }); }); </script></head><body style="overflow: hidden;" class='default'> <div id="jqxgrid"></div></body></html>
Hope this helps.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks,
but the fourlabels :
localizationobj.pagergotopagestring = “Gehe zu:”;
localizationobj.pagershowrowsstring = “Zeige Zeile:”;
localizationobj.pagernextbuttonstring = “voriger”;
localizationobj.pagerpreviousbuttonstring = “nächster”;don’t work and
localizationobj.pagerrangestring = ” von “;
localizationobj.sortascendingstring = “Sortiere aufsteigend”;
localizationobj.sortdescendingstring = “Sortiere absteigend”;
localizationobj.sortremovestring = “Entferne Sortierung”;work
Steve
I uploaded the sample and you can see it working Online: Localization
Hope it helps.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI use the same code in the demo file bindingtojson.htm and i have the previous problem :
the four labels :
localizationobj.pagergotopagestring = “Gehe zu:”;
localizationobj.pagershowrowsstring = “Zeige Zeile:”;
localizationobj.pagernextbuttonstring = “voriger”;
localizationobj.pagerpreviousbuttonstring = “nächster”;don’t work and
localizationobj.pagerrangestring = ” von “;
localizationobj.sortascendingstring = “Sortiere aufsteigend”;
localizationobj.sortdescendingstring = “Sortiere absteigend”;
localizationobj.sortremovestring = “Entferne Sortierung”;work.
Maybe it’s append only when source type is json ???
Steve
Hi Steve,
You can tell me what’s the datatype that you use and I will prepare a demo for you with that specific datatype. The demo I posted is with JSON. It does not matter whether the datatype is json, xml, array, csv or tsv. However, I think that it would be easier, if you send us a small sample to support@jqwidgets.com so we can debug the specific scenario.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Steve,
If your loading json data, it is important to set the datatype to ‘json’.
For example:
var source = { datatype: "json", datafields: [ { name: 'name' }, { name: 'type' }, { name: 'calories', type: 'int' }, { name: 'totalfat' }, { name: 'protein' }, ], id: 'id', url: 'beverages.txt', async: false };
jQWidgets Team
http://www.jqwidgets.comIt’s work fine
Thanks
Steve
-
AuthorPosts
You must be logged in to reply to this topic.