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

@vdt-jquery/jquery-datagridview

v1.3.1

Published

A jQuery plugin that makes it easy to create a grid view for your tabular data. It allows you to create a table layout on the fly for an array of data-objects while leaving you in full control of where the data comes from.

Downloads

27

Readme

jQuery-datagridview

A jQuery plugin that makes it easy to create a grid view for your tabular data. It allows you to create a table layout on the fly for an array of data-objects while leaving you in full control of where the data comes from.

Features

  • Supports sorting and paging
  • Single- and multiselect support
  • Resizable headers and movable headers
  • Programmatic access to the datagridview for manipulating selection
  • Easy to set up with data-attributes inside your html elements
  • Easy to adapt either by changing the defaults or providing options in-line

Basic usage

Includes:

<link rel="stylesheet" href="Content/jquery-datagridview.min.css" />
<link rel="stylesheet" href="Content/jquery-datagridview.style.min.css" />
<script type="text/javascript" src="Scripts/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-datagridview.min.js"></script>

Html and javascript:

<div id="example-table" data-select="true" data-multiselect="true"></div>

<script type="text/javascript">
    $('#example-table').datagridview({
        columns: [
            { data: 'firstName' },
            { data: 'lastName' }
        ]
    });
</script>

<script type="text/javascript">
    $('#example-table').datagridview(function () {
        this.populate(new DataGridViewMetaData(null, false, 2, 25, 0), [
            { firstName: 'Keanu', lastName: 'Reeves' },
            { firstName: 'Laurence', lastName: 'Fishburne' }
        ]);
    });
</script>

This will generate a datagridview with multiselect, sorting and paging enabled.

Styling

The datagridview only provides very basic styling in the provided style sheet jquery-datagridview.style.css; you can use this as a template to create your own style. The various css classes the data grid uses are:

  • .datagridview is the original element and the main container of the datagridview
  • .datagridview-content-container is the scroll container for the header and body
  • .datagridview-header is the container for the header cells
  • .datagridview-header-cell are the individual column headers within the header
  • .datagridview-header-cell-sortable are only the sortable column headers
  • .datagridview-header-cell-sorted is the header cell that's currently sorted
  • .datagridview-header-drag are the elements to hold to drag to change column size
  • .datagridview-header-move-title element contains the header title of the header that's being dragged to move a column and is attached to the mouse position
  • .datagridview-header-move-indicator is the arrow pointing at the new column position while dragging a header to move a column
  • .datagridview-sort-toggle is the element displaying the current sort order if applicable
  • .datagridview-sort-toggle-ascending gets added to the sort toggle when sorting ascending
  • .datagridview-sort-toggle-descending gets added to the sort toggle when sorting descending
  • .datagridview-body is the container for the grid rows
  • .datagridview-row are the data rows inside the body that contain the data
  • .datagridview-row-selecting gets added to rows when a user is selecting (with mouse down)
  • .datagridview-row-selected gets added to rows that are currently selected
  • .datagridview-row > div can be used to access cells in the data rows
  • .datagridview-cell-sorted are the cells in the column that's currently sorted
  • .datagridview-total-row is the totals row inside the body
  • .datagridview-footer is the container for the footer (paging) elements
  • .datagridview-footer-element are the containers for each separate footer (paging) plugin

Documentation

Full documentation can be found at the wiki