Getting Started

DataGrid Library is a simple and powerful solution to enable sorting, filtering, and pagination on any page.

On behalf of our team, we would like to thank you for purchasing this library. Your support encourages us to build better plugins and continuously bring value to our products. This documentation file covers all the information needed to install and use this library.

Bootstrap 5 Example

Let's build a page based on Bootstrap 5 with a text filter by item title. Get started with a minimal Bootstrap layout as described in Bootstrap 5 documentation:

index.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>DataGrid Example</title>

        <!-- Required meta tags -->
        <meta charset="utf-8" />
        <meta name="viewport" 
            content="width=device-width, initial-scale=1, shrink-to-fit=no" />

        <!-- Bootstrap CSS -->
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" 
              rel="stylesheet" 
              integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" 
              crossorigin="anonymous" />
    </head>
    <body>


        <!-- Bootstrap Script (Optional) -->
        <script 
            src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" 
            integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" 
            crossorigin="anonymous"></script>
    </body>
</html>

DataGrid library can be used with any CSS Framework or with your custom HTML & CSS.

Copy-paste the stylesheet <link> into your <head> to load DataGrid CSS:

Place the <script> near the end of your pages, right before the closing </body> tag:

Add a container element that will hold all items that need to be filtered, sorted, etc. This container should have thedata-gridattribute.

Add several items to the container. The items can have any HTML layout, for example like this:

Every item should havedata-grid-item attribute.

Let's add text filter control:

data-path attribute points to the text that should be filtered. It accepts any valid CSS selector string, for example, class or ID.

Add DataGrid library initialization:

DataGrid settings can be passed in the following way:

The final version:

Last updated

Was this helpful?