<script>
ej.base.L10n.load({
'pt-BR': {
'grid': {
EmptyRecord: 'Nenhum registro para exibir',
True: 'real',
False: 'falso',
. . . . .
},
'pager': {
currentPageInfo: '{0} de {1} páginas',
totalItemsInfo: '(Elementos {0})',
. . . . .
}
}
});
</script>
<div>
@Html.EJS().Grid("Grid").Locale("pt-BR").DataSource((IEnumerable<object>)ViewBag.datasource).Columns(col =>
{
col.Field("OrderID").IsPrimaryKey(true).HeaderText("Name").Width("160").Add();
. . . . .
col.Field("Verified").HeaderText("Verified").Width("150").Add();
}).AllowPaging().Render()
</div> |
<script>
function loadCultureFiles(name) {
var files = ['numbers.json', 'timeZoneNames.json', 'currencies.json', 'ca-gregorian.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('pt-BR');
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
document.addEventListener('DOMContentLoaded', function () {
// load corresponding cldr-data
loadCultureFiles('pt');
});
</script> |
@(Html.EJS().Grid("Grid").ActionComplete("actionComplete")
...
.Render())
<script>
function actionComplete(e) {
if (e.requestType == 'add' || e.requestType == 'beginEdit') {
var formValidator = e.form.ej2_instances[0];
ej.base.extend(formValidator.defaultMessages, {
required: "Este campo é obrigatório"
});
}
}
</script>
|