Skip to content

5.6.0 - use optional PubSub with Web Component

Compare
Choose a tag to compare
@ghiscoding ghiscoding released this 08 Dec 02:38
· 228 commits to master since this release

5.6.0 (2023-12-08)

Quick Info

You can now provide an optional PubSub Service to SlickGrid and SlickDataView to use as a single PubSub, this makes it a lot easier for Web Component based framework like Angular/React/Vue... For example, we can create a PubSub Service which uses JavaScript CustomEvent which we can then use to send all possible events (SlickGrid, DataView, plugins...) to our web component, which is another alternative instead of having to subscribe to individual SlickEvent instances (grid, dataview, plugins, ...)

The best example can be seen in Angular-Slickgrid project where it used that approach with CustomEvent, with this approach we can now easily add attribtues to receive the Custom Events, similar to what is shown below

<my-component
    on-before-menu-show="onBeforeMenuShow"
    on-menu-close="onMenuClose"
    on-paging-info-changed="onPagingInfoChanged"
    on-before-paging-info-changed="onBeforePagingInfoChanged">
</my-component>

For a full demo, take a look at Example - Web Component with PubSub Service. Please note that the PubSub Service is just a quick demo, you probably want a better service.


Bug Fixes

  • calling applyHtmlCode() with number/boolean (#942) (b1b4fa2)
  • Draggable Grouping, destroy all Sortable instances fixes mem leak (#943) (eb30086)

Features

  • introduce devMode to support nodejs based unit testing (#946) (918efa4)
  • use PubSub Service with Web Component demo to subscribe instead of SlickEvent (#859) (7d602e6)

Quick Survey ✨

We also made a quick little poll for fun, thanks for taking the time to participate

What do you think was the most exciting change(s) for you?