jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Localization in DateTimeInput on Grid dont work
Tagged: aligment, align, calendar, datetimeinput, grid, localization, problem
This topic contains 2 replies, has 2 voices, and was last updated by gabrynio 12 years, 4 months ago.
-
Author
-
Hello,
I’ve got problem with localization of calendar (DateTimeInput) in Grid.When using DateTimeInput on normal input, localization is working (after adding my culture file in globalization folder).
But I cant make it work on grid. Localization on other columns work (for example currency).By the way I’ve got other problem with calendar popup. Name of months is vertically aligned to bottom.
Link do screen (aligment & localization problem): http://gabrieloczkowski.pl/_projekty/calendarProblem.jpg
Code:
var lista = { localdata: data, datatype: "array", datafields: [ {name: 'typ', type: 'string'}, {name: 'nazwa', type: 'string'}, {name: 'dataod', type: 'date'}, {name: 'datado', type: 'date'}, {name: 'kontrahent', type: 'string'}, {name: 'pm', type: 'string'}, {name: 'am', type: 'string'}, {name: 'procent', type: 'number'}, {name: 'etap', type: 'string'} ] }; var dataAdapter = new $.jqx.dataAdapter(lista); $("#box-lista").bind('bindingcomplete', function () { var localizationobj = {}; localizationobj.firstDay = 1; localizationobj.percentsymbol = "%"; localizationobj.currencysymbol = " PLN"; localizationobj.currencysymbolposition = "after"; localizationobj.decimalseparator = ","; localizationobj.thousandsseparator = " "; var days = { names: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], namesAbbr: ["Niedz", "Pon", "Wt", "Śr", "Czw", "Piąt", "Sob"], namesShort: ["Niedz", "Pn", "Wt", "Śr", "Cz", "Pt", "Sob"] }; localizationobj.days = days; var months = { names: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień", ""], namesAbbr: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru", ""] }; localizationobj.months = months; $("#box-lista").jqxGrid('localizestrings', localizationobj); }); $("#box-lista").jqxGrid({ width: 980, source: dataAdapter, altrows: true, autoheight: true, sortable: true, theme: 'grayTheme', columnsresize: true, editable: true, columns: [ { text: 'Typ', datafield: 'typ', width: 60, cellsalign: 'center', align: 'center' }, { text: 'Nazwa', datafield: 'nazwa', width: 110, cellsalign: 'center', align: 'center' }, { text: 'Data od', datafield: 'dataod', width: 90, cellsalign: 'center', align: 'center', columntype: 'datetimeinput', cellsformat: 'yyyy-MM-dd'}, { text: 'Data do', datafield: 'datado', width: 90, cellsalign: 'center', align: 'center', columntype: 'datetimeinput', cellsformat: 'yyyy-MM-dd'}, { text: 'Kontrahent', datafield: 'kontrahent', width: 210, cellsalign: 'center', align: 'center' }, { text: 'PM', datafield: 'pm', width: 130, cellsalign: 'center', align: 'center' }, { text: 'AM', datafield: 'am', width: 130, cellsalign: 'center', align: 'center' }, { text: '%', datafield: 'procent', width: 130, cellsalign: 'center', align: 'center', cellsformat: 'c1' }, { text: 'Etap', datafield: 'etap', width: 30, cellsalign: 'center', align: 'center' } ] });
Hi gabrynio,
1. The provided theme is not available in our product and that is the reason the alignments in the image are wrong. You should also check whether you have CSS conflicts on your page.
2. To localize editors, filters, you should use the createeditor, and createfilterwidget callback functions. Then to apply localization of jqxDateTimeInput, take a look at its “Localization” sample.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com1. The problem with alignments occurs even with prebuild themes. This theme is generated by ThemeBuilder. Problem dissapear when i write CSS on TD (vertical-align:middle). I will try later again on clean project with grid only.
Meybe problem occurs because I use Eric Meyer’s “Reset CSS”.2. Thanks. I will try this method and let u know if it works.
Best Regards,
Gabriel -
AuthorPosts
You must be logged in to reply to this topic.