Internationalization
Added internationalization configuration
-
en.js
is the default file used. When you define another languagelang="es"
it will look for that registered lang filees.js
. If that file doesn't exist then the grid will use smart defaults for that language as best as it can for currency and date columns. -
Defaults to lang set on html tag
<html lang=”es”>
-
Can set lang per grid
<zing-grid lang=”es”>
-
Can set global lang through api
ZingGrid.setLanguage(‘es’);
-
Can set custom lang file with
ZingGrid.registerLanguage(obj, 'custom')
and the appropriate language file JavaScript object. Demo -
Added HTML standard direction
dir="rtl"
anddir="ltr"
Demo -
Added internationalization to date columns. If you define
<zg-column type="data" locale="de">
it will add the appropriate formatting to that column. The columns will default to the global<html lang
attribute, then<zing-grid lang
and the<zg-column lang
will override all. -
Added conventionally standard tokens (moment.js) to date columns for custom date formatting
<zg-column type=”date” type-date-format=”[Month:] MM”>
Demo -
Refined currency columns for smart defaults to detect lang to format numbers. You still need the
type-currency="EUR"
attribute to define the currency symbol. Demo -
Added locale to number renderer Demo
-
Refined filter/search to match the current language
-
If the default lang on the page is english then we use standard sort. If you have any other language defined you can override sort/filter functionality with the following properties:
You can turn this off with<zing-grid sort-intl=”disabled”>
You can turn this ON with<zing-grid sort-intl>
and<zg-column sort-intl>
-
Added
defaultdisplay
attribute tozinggrid
andzgcolumn
to display when the data value is null or undefined Demo -
Added
[position="both"]
attribute to<zgsource>
Demo -
Added
compact
property to<zinggrid>
to mirror[compact]
attribute Demo -
Added
params
property (not attribute) to ZingGrid to allow setting of data params via JavaScript -
Added
params
property tonew ZingGrid
to allow setting of data params on object render:// define params for fetching data const params = { // define the main source for the API src: 'https://swapi.co/api/people/', // define the path in the JSON to get the array of results. In this case it is body.results recordPath: 'results', // if loadByPage is set to true it will go to the server for each new page of data loadByPage: 'true', // define the "page" query parameter pageKey: 'page', // Need to tell ZG how many records were returned so it knows how to divide up the page-size countPath: 'count', // define the path in the result JSON to find next/prev urls nextPath: 'next', // define the path in the result JSON to find next/prev urls prevPath: 'previous', // Need to tell ZG how mto search the API searchKey: 'search', };
-
Changed
getWidth()
andgetHeight()
API methods to return the actual<zinggrid>
width and height. -
Modified
<zinggrid>
[width]
attribute to take values besidespx
. If no unit is specified, defaults topx
-
Added sorter style to the footer on sorting
Bug Fixes
- Fixed issues with Number Renderer
- Fixed data being returned on events to always be an object
- Fixed autoscroll bug on resizing