github ZingGrid/zinggrid v1.1.1

latest releases: 1.7.2-1, 1.7.2, 1.7.1...
5 years ago

Internationalization

Added internationalization configuration

  • en.js is the default file used. When you define another language lang="es" it will look for that registered lang file es.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" and dir="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 to zinggrid and zgcolumn 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 to new 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',
      };

    Demo

  • Changed getWidth() and getHeight() API methods to return the actual <zinggrid> width and height.

  • Modified <zinggrid> [width] attribute to take values besides px. If no unit is specified, defaults to px

  • 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

Don't miss a new zinggrid release

NewReleases is sending notifications on new releases.