jQWidgets ver. 27.2.0
What’s New #
- React Grid: rows from React state
The rows prop takes the grid’s rows as an array from React state, without a data adapter, and rowKey names the field that identifies a row. A new array updates only the rows that changed (found by rowKey), or binds the data again when rows were added, removed or moved; either way the sort, filters and groups stay. The rows can start empty and be filled once the data has been fetched. fieldTypes names a field’s type when its values do not tell. Rows given this way are sanitized by default (enableSanitize), so a value with a script handler or a dangerous tag shows as text; open row details stay open when rows are added or removed; changing many rows of a large table is one update.
- React Grid: React components in cells, editors, headers, bars and row details
A column’s cellComponent renders a React component in each of its cells, with the cell’s value and row; the cells follow the grid as it scrolls, sorts, groups and pages, get the app’s context, and keep their state while their row is shown (through sorting, refreshing and changes to the row). A column’s editorComponent is a custom editor written as a React component: it gets the value and onChange, onCommit and onCancel, and Enter, Esc and Tab work as with the built-in editors. A column’s headerComponent renders its header; toolbarComponent and statusbarComponent fill the toolbar and the status bar (they get the grid, to call its methods); rowDetailsComponent renders each row’s details, for a master-detail view inside the grid.
- React Grid: selection and sort as React state
selectedRowKeys sets the selected rows by their keys and onSelectionChange reports the user’s changes; sort and onSortChange do the same for the sort. The app can keep them in its state or the URL, and share them with other components; like a controlled input, the grid shows what the props say, so the app can also refuse a change.
- React Grid: server mode
With totalRows, the rows prop is the page the server sent: the grid pages, sorts and filters through onQueryChange, which gets the page, page size, sort and filters to fetch, and loading shows the grid’s loading indicator while a request runs. A server-side grid takes these three props instead of a data adapter with callbacks.
- React Grid: types
JqxGrid<T> takes the rows’ type from the rows prop, so a cellComponent, an editorComponent and the columns know the row’s fields. IGridEvents<T> types each event’s arguments, for handlers that name them: (event: IGridEvents<Order>[‘cellendedit’]) => … .
- React components: props compared by content
All React components compare their array and object props by content: an inline columns={[…]} no longer rebuilds the grid on every render (which bound its data again and dropped the sort). The grid’s column functions (cellsrenderer, validation…) always call the latest function, so an inline renderer shows the current state. In development, a component warns once when a prop is made again on every render (a new jqx.dataAdapter over the same source, an inline component in a column). ready, and events raised while a component is created (the grid’s first bindingcomplete), now reach the app after React has set its refs.
- React components: server rendering
A page rendered on a server (Next.js) hydrates without warnings; the grid modules load on a server.
- jqxGrid: grouping with virtual scrolling
A grid in virtual mode without paging can now be grouped (before, it threw “grouping in virtualmode without paging is not supported”). The new rendergroups function returns the groups and the number of rows in each, for the grouping in use (a GROUP BY with COUNT on a server); rendergridrows returns the rows in the groups’ order. The grid lays out the group headers and asks only for the rows of the expanded groups in view, so a million rows are grouped without being loaded. Groups expand and collapse with the mouse and with expandgroup, collapsegroup, expandallgroups and collapseallgroups; columns dragged to the group panel or removed from it regroup the grid; a groupsrenderer gets the group’s row count (groupdata.count). Demo: jqxGrid, Virtual Scrolling with Grouping.
- API definitions
About 400 members that the components had but the API definitions lacked are now in the TypeScript definitions, the Angular, React and Vue components and the API pages: for example jqxWindow autoFocus, jqxSlider tickMode and tickNumber, jqxListBox checkboxSize, jqxTabs lockAt and getEnabledTabsCount, jqxKanban expandColumn and selectItem, jqxGrid hiderow, showrow, isrowhiddenat and scrollto, jqxChart getPlotAreaRect, and hint in the input widgets. Defaults that differed from the widgets’ are corrected; in Vue they changed the widgets’ behaviour: week numbers in jqxCalendar and jqxDateTimeInput, dropping in jqxListBox and jqxTree, and jqxGantt’s timeline header.
What’s Fixed #
- Pages without jQuery
jqWidgets’ own jQuery-compatible core, used when a page loads no jQuery, now behaves like jQuery 3 where the widgets and apps rely on it: sizes are no longer rounded, :visible and :hidden, offset and position, show and hide, ready handlers, pointer, touch and key event properties, and focus, blur and click raised from code. $.when waits for native Promises and .css() sets CSS variables; bind, unbind, one and finish are there. Of 931 jQuery demos, 49 now behave differently without jQuery (508 before).
- Widgets destroyed by a framework
destroy removes everything a widget made: jqxBarGauge’s animations, jqxScrollView’s slide show and size watcher (and refresh no longer starts another slide show), jqxLoader’s modal overlay, jqxDragDrop’s handlers and instance, jqxKnob’s size watcher. A widget watching its size no longer leaves a timer running after it is destroyed.
- jqxGrid
Cancelling an edit raised cellendedit with the editor’s value as the new value, so an app saving from that event saved the cancelled value. A custom editor on a column with a cellsformat saved an empty value. Characters typed quickly into a number cell editor were lost, and Enter then threw. Unmounting the grid right after an edit threw. isrowhiddenat did not see rows hidden with hiderow. Updating a row (updaterow) closed every open row details and forgot the rows hidden with hiderow and the heights set with setrowheight. With enableSanitize set when the grid was created, a sanitized value showed its HTML entities as text (escaped twice). autoselectfirstrow selected the first row when a mouse click on a column header moved the focus into the grid, and on a sorted grid it could select another row than the first one shown. The title of a sorted or filtered column ran under its sort icon when it was right-aligned or long (a “Total” column showed “Tota”), in all themes. With selectionmode ‘checkbox’, columns whose percentage widths add up to 100% overflowed the grid by the check box column’s width and showed a horizontal scrollbar; the percentages are now of the width left beside it, as with row details. In the Fluent, Light and Tailwind themes (and their dark and blue variants), React components in the grid (cells, editors, headers, bars and row details) keep their own text colour in a selected row and their own input padding. CSV, TSV, JSON, XML, HTML and XLS exports without an exportServer (jqxGrid, jqxDataTable, jqxTreeGrid and the other widgets that export through jqxdata.export.js) are now made in the browser: the data is no longer sent to an export server on the internet (outside jqwidgets.com that was http://jquerygrid.net, over plain http). Pass exportServer to keep using a server of your own. A number column without a cellsformat is exported as the grid shows it (39, 10248), no longer with two decimals and group separators (“39.00”, “10,248.00”); give the column a cellsformat for a formatted export.
- Drop-down popups behind the page
The popups of jqxDropDownList, jqxComboBox, jqxDateTimeInput and jqxDropDownButton (the grid pager’s “Show rows” list among them) opened behind the page when the widget sat in a container with a z-index above 9999, as in an application shell that is a fixed, full-page layer: the popups’ z-index was a fixed 9999 (!important, so popupZIndex could not change it). A popup now opens one above the highest z-index among its widget’s containers.
- Other fixes
jqxKanban expandColumn and selectItem threw. jqxTreeMap clearSelection left sectors selected. jqxChart clear() made cleared charts share their series. jqxSortable raises remove with removeItem. jqxGauge and jqxKnob accept styles, the name the Vue and Angular components use.
|
|