proton-state

0.4.0 • Public • Published

proton-state

examples

https://codesandbox.io/s/github/ptrushin/proton-state-examples

Try to play:

  • Add filter Category - Address bar and Grid changed
  • Add filter Product, it depends on Category
  • Change filter on column OrderDate in Gird - Address bar and Grid changed
  • Click with alt key on cell in column Quantity - all filtered by its value - Address bar and Grid changed
  • Now you can copy address from address bar and open it in other tab - all filters applied
  • Change column order and reload page, now aggird state store in localstorage and you can copy/paste state

install

npm install proton-state

add to AgGrid

in component ctor

this.protonState = new ProtonState(
{
    history: props.history,
    onChange: this.onStateChange
});

in componentDidMount and componentDidUpdate

this.protonState.updateState();

in onGridReady AgGrid event

onGridReady = params => {
    this.protonState.addStateProvider(new AgGridStateProvider({api: params.api}))
    ...

/proton-state/

    Package Sidebar

    Install

    npm i proton-state

    Weekly Downloads

    4

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    61.6 kB

    Total Files

    22

    Last publish

    Collaborators

    • ptrushin