npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

slickgrid2

v16.0.10

Published

SlickGrid with pinning, more customizability & faster column sizing

Downloads

24

Readme

slickgrid2

Note: This is not the original SlickGrid. Go here if you want the original.

Benefits of this implementation over the original SlickGrid

  • TypeScript types support

  • Adds some methods that make it more performant to do auto column resizing and exposes some methods that make it easier to work with multiple grid instances and pinned columns.

  • grid.updateColumnWidths(columnDefinitions)

    • Using this method improves the performance of changing the width of one or more grid columns by a lot. The existing API only allows for a whole grid redraw, which can be very slow. Pull request with notes here. Use cases for fast column size adjustment may be: auto-sizing columns to fit content, responsive sizing cells to fill the screen, and similar.
  • grid.updateColumnHeader

    • when called, also ensures that column.headerCssClass gets applied to the header DOM element
    • motivation: <1ms per column, versus 100-200ms when calling grid.setColumns()
  • grid.updateColumnHeaders

    • calls grid.updateColumnHeader for all columns
  • grid.getId() lets you get the uid of the grid instance

  • grid.isGroupNode(row, cell) lets you check if a node is part of a group row

  • Triggers existing event onColumnsResized when you change the column widths

  • Triggers a new event onColumnsChanged when you set the columns

  • Exposes the existing method grid.setupColumnResize, which allows you to re-enable column resizing if you're manually screwing around with the headers.

  • Some new options on setColumns and resizeCanvas let you prevent some of the expensive calculations, useful if you're doing them yourself externally.

  • Add an explicit event dataView.onFilteredItemsChanged event to capture when filtered items change, since dataView.onRowsChanged doesn't capture this.

  • Adds an event dataView.onSetItems that fires when items get set.

  • In row metadata objects, prioritize rowMeta.columns[idx].{ focusable, selectable } over rowMeta.{ focusable, selectable }

  • Adds antiscroll compatibility to enable a uniform, OSX-style scrolling experience across browsers. Enable antiscroll by including the antiscroll library on your page, and passing the useAntiscroll: true option to your SlickGrid instance. By default we don't show scrollbars until the user begins scrolling (to mimic the way OSX does it); to change that behavior, you can set the showScrollbarsOnHover option.

  • Adds skipPaging option to prevent slickgrid from paging when user keypress take the user off the current page. Instead, up & down keypresses reveal one new row at a time.

  • Exposes grid as the final parameter of the asyncPostRender callback. Signature is now asyncPostRender(node, row, dataRow, column, grid)

  • Adds appendSubheadersToContainer option to allow injecting the subheaders straight into the root of the container, which is useful for absolutely positioning them relative to the container (eg. for a fixed footer). Note: this feature does not support pinned columns.

  • Adds scrollbarSize and maxSupportedCssHeight options. Pass these in if you know their values beforehand to avoid layout thrashing on load.

  • Adds the withTransaction(fn) method on SlickGrid as a shorthand for dataview.beginUpdate(), dataview.endUpdate(), and invalidateSafe()

  • Adds the invalidateSafe() method, for safely invalidating data without cancelling the current edit.

  • Adds the getData().getLengthWithoutGroupHeaders() method.

  • Adds the enableColumnResize option.

  • Adds the onBeforeKeyDown event (#33) to be able to intercept keys like Enter, etc. prior to the keydown event so you can perform actions like saving, etc. without being cut short by stopPropagation.

Highlights of the original SlickGrid

  • Adaptive virtual scrolling (handle hundreds of thousands of rows with extreme responsiveness)
  • Extremely fast rendering speed
  • Supports jQuery UI Themes
  • Background post-rendering for richer cells
  • Configurable & customizable
  • Full keyboard navigation
  • Column resize/reorder/show/hide
  • Column autosizing & force-fit
  • Column pinning
  • Pluggable cell formatters & editors
  • Support for editing and creating new rows.
  • Grouping, filtering, custom aggregators, and more!
  • Advanced detached & multi-field editors with undo/redo support.
  • “GlobalEditorLock” to manage concurrent edits in cases where multiple Views on a page can edit the same data.
  • Support for millions of rows

Column Pinning Design

To support pinned columns, we slice up the grid regions, and try to be very clear and consistent about the naming. This is because having a left and right region for every content area makes a flat list of naming conventions multiply quickly.

Canvases always represent content size, viewports always represent scrollable regions.

Every element has side [0] and side [1], for left and right.

Visual Grid Components
                        [0]       [1]
                      ....................
topViewport           .     .            .     // The scrolling region
  topCanvas           .     .            .     // The full size of content (both off and on screen)
    header            .     .            .     // The column headers
    subHeader         .     .            .     // Optional row of cells below the column headers
                      ....................
contentViewportWrap   .     .            .
contentViewport       .     .            .     // The scrolling region for the grid rows
  contentCanvas       .     .            .     // Full size of row content, both width and height
                      .     .            .
                      .     .            .
                      .     .            .
                      .     .            .
                      .     .            .
                      ....................

Requirements

  • jQuery v2 (jquery.threedubmedia doesn't work on jQuery v3 so it has to be v2 for now)
  • Lodash