<script type="text/javascript">
ej.base.L10n.load({
'pt': {
'grid': {
'EmptyRecord': 'Nao existem dados para exibicao'
},
'pager': {
'currentPageInfo': '{0} de {1} paginas'
},
'datepicker': {
'placeholder': 'selectione a data'
},
'numerictextbox': {
'incrementTitle': 'incrementar valor'
},
'dropdowns': {
'noRecordsTemplate': 'Nenhum registro foi encontrado',
'actionFailureTemplate': 'A solicitação falhou'
}
}
});
function loadCultureFiles(name) {
ej.base.setCulture(name);
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json'];
if (name === 'pt') {
files.push('numberingSystems.json');
}
var loader = ej.base.loadCldr;
var loadCulture = function (prop) {
var val, ajax;
if (name === 'pt' && prop === files.length - 1) {
ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/supplemental/' + files[prop], 'GET', false);
} else {
ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', false);
}
ajax.onSuccess = function (value) {
val = value;
};
ajax.send();
loader(JSON.parse(val));
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
document.addEventListener('DOMContentLoaded', function () {
loadCultureFiles('pt');
});
</script> |
<div id="Grid1"></div>
<script type="text/javascript">
ej.grids.Grid.Inject(ej.grids.Page, ej.grids.Edit, ej.grids.Group, ej.grids.Toolbar);
var data = [{
'OrderID': 10248,
'CustomerID': 'VINET',
'OrderDate': '1996-07-04T00:00:00.000Z',
'Freight': 32.38
},
. . . .
];
var grid = new ej.grids.Grid({
dataSource: data,
gridLines: 'Both',
height: '300px',
locale: 'pt',
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true },
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
columns: [
{ field: 'OrderID', headerText: 'Order ID', isPrimaryKey: true, textAlign: 'Right', width: 120 },
. . . .
]
});
grid.appendTo('#Grid1');
</script>
<input id="autocomplete1" />
<script type="text/javascript">
var auto = new ej.dropdowns.AutoComplete({
locale: 'pt'
});
auto.appendTo('#autocomplete1');
</script>
<input id="datepicker1" class="col-lg-12 control-section" />
<script type="text/javascript">
var datepicker = new ej.calendars.DatePicker({
locale: 'pt'
});
datepicker.appendTo('#datepicker1');
</script> |