[_Layout.cshtml]
<script>
function loadCultureFiles(name) {
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json', 'currencies.json'];
var loadCulture = function (prop) {
var val, ajax;
ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', true);
ajax.onSuccess = function (value) {
val = value;
ej.base.loadCldr(JSON.parse(val));
};
ajax.send();
ej.base.setCulture('it');
ej.base.setCurrencyCode('EUR');
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
document.addEventListener('DOMContentLoaded', function () {
loadCultureFiles('it');
});
</script>
[Index.cshtml]
@Html.EJS().Grid("GridJ2").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowGrouping(true).Locale("it")...Render()
|
Hi Andrew,
Thanks for contacting Syncfusion support.
We have analyzed your query. We suggest you to load corresponding culture’s(in your case es-MX) CLDR data files using AJAX and also set the locale property for Grid to achieve this requirement. Please refer the below documentations,Documentations :
Sample : http://www.syncfusion.com/downloads/support/directtrac/general/ze/gridmvclocalization-1160600388
In the below code, we have loaded the cldr data files of Italian culture(you can load the es-MX culture files just like what we have done for italian) to apply the Italian culture formats to the application,
[_Layout.cshtml]<script>function loadCultureFiles(name) {var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json', 'currencies.json'];var loadCulture = function (prop) {var val, ajax;ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', true);ajax.onSuccess = function (value) {val = value;ej.base.loadCldr(JSON.parse(val));};ajax.send();ej.base.setCulture('it');ej.base.setCurrencyCode('EUR');};for (var prop = 0; prop < files.length; prop++) {loadCulture(prop);}}document.addEventListener('DOMContentLoaded', function () {loadCultureFiles('it');});</script>[Index.cshtml]@Html.EJS().Grid("GridJ2").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowGrouping(true).Locale("it")...Render()
Please get back to us if you need further assistance.
Regards,Thavasianand S.
<script>
function loadCultureFiles(name) {
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json', 'currencies.json'];
var loadCulture = function (prop) {
var val, ajax;
ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', true);
ajax.onSuccess = function (value) {
val = value;
ej.base.loadCldr(JSON.parse(val));
};
ajax.send().then(function (args) {
ej.base.setCulture('es-MX');
ej.base.setCurrencyCode('MXN');
});
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
document.addEventListener('DOMContentLoaded', function () {
loadCultureFiles('es-MX');
});
</script>
|
.e-grid span.e-headertext, .e-grid .e-groupcaption {
font-size:15px;
} |