---
title: Data Grid View
product: Form Library
description: Browse a read-only SurveyJS data grid in JavaScript. Search and filter orders, sort by column, and page through the matching rows.
framework: jQuery
source: https://surveyjs.io/form-library/examples/data-grid-view/jquery
index: https://surveyjs.io/form-library/examples/overview.md
---

# Data Grid View (jQuery)

Data Grid View enables your users to explore large datasets with ease. Built with a read-only [Dynamic Matrix](/form-library/documentation/api-reference/dynamic-matrix-table-question-model), it brings search, filtering, sorting, and pagination together so that users can find the records they need and choose which matches to review first. Their search, filters, and sort order stay active as they move between pages.

Refer to the following demos for information on how to configure search, filtering, sorting, and pagination for your own grid:

[Filter and Search Matrix Rows](/form-library/examples/filtering-in-matrices/ (linkStyle))

[Sort Matrix Rows](/form-library/examples/sorting-in-matrices/ (linkStyle))

[Paginate Matrix Rows](/form-library/examples/paging-in-matrices/ (linkStyle))

Make the following additional adjustments when configuring a Dynamic Matrix as a data grid view:

- [`keyName: "id"`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#keyName)\
Designates `id` as the key column.

- [`readOnly: true`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#readOnly)\
Prevents users from editing cells and from adding or removing rows.

- [`readOnlyMode: "view"`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#readOnlyMode)\
Displays read-only cell values as text.

- [`choices`](/form-library/documentation/api-reference/dropdown-menu-model#choices)\
Maps stored choice values to display labels. For example, the **Status** column displays **Shipped** for the value `"shipped"`.

- [`alternateRows: true`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#alternateRows)\
Shades every other row.

- [`hideColumnsIfEmpty: true`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#hideColumnsIfEmpty)\
Hides the table when no rows are visible.

- [`noRowsText: "No orders match your filters."`](/form-library/documentation/api-reference/dynamic-matrix-table-question-model#noRowsText)\
Sets the message shown when `hideColumnsIfEmpty` hides the table.

- [`showNavigationButtons: false`](/form-library/documentation/api-reference/survey-data-model#showNavigationButtons)\
Hides survey navigation buttons, including **Complete**, when set at the survey level.

## See Also

[Record Card View](/form-library/examples/record-card-view/ (linkStyle))

## Files

### `public/index.html`

```html
<link href="https://fonts.googleapis.com/css?family=Open%20Sans:400,600&display=swap" rel="stylesheet">
<div id="surveyElement" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-height: 100%; height:100%"></div>
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/index.js`

```js
import $ from "jquery";
import { Model } from "survey-core";
import "survey-js-ui";
import "survey-core/survey-core.min.css";
import "./index.css";
import { json } from "./json";

const survey = new Model(json);
survey.onComplete.add((sender, options) => {
    console.log(JSON.stringify(sender.data, null, 3));
});
survey.data = {
  orders: [
    { id: 1001, customer: "Bob Brown", product: "Mouse", status: "shipped", total: 156 },
    { id: 1002, customer: "Grace Smith", product: "Laptop", status: "delivered", total: 1290 },
    { id: 1003, customer: "Quinn Smith", product: "USB-C cable", status: "shipped", total: 30 },
    { id: 1004, customer: "Elena Tanaka", product: "Monitor", status: "shipped", total: 340 },
    { id: 1005, customer: "Bob Rossi", product: "Monitor", status: "shipped", total: 1700 },
    { id: 1006, customer: "Liam Garcia", product: "Laptop", status: "shipped", total: 6450 },
    { id: 1007, customer: "Sven Chen", product: "USB-C cable", status: "shipped", total: 75 },
    { id: 1008, customer: "Rosa Larsen", product: "Desk lamp", status: "delivered", total: 90 },
    { id: 1009, customer: "Noah Novak", product: "Mouse", status: "delivered", total: 117 },
    { id: 1010, customer: "Olga Petrova", product: "Webcam", status: "processing", total: 178 },
    { id: 1011, customer: "Ines Tanaka", product: "Laptop", status: "new", total: 2580 },
    { id: 1012, customer: "Tara Silva", product: "Docking station", status: "cancelled", total: 657 },
    { id: 1013, customer: "Liam Kowalski", product: "Monitor", status: "cancelled", total: 340 },
    { id: 1014, customer: "Pablo Ivanova", product: "Keyboard", status: "cancelled", total: 316 },
    { id: 1015, customer: "Noah Haddad", product: "Docking station", status: "shipped", total: 219 },
    { id: 1016, customer: "Ann Silva", product: "Monitor", status: "new", total: 680 },
    { id: 1017, customer: "Grace Müller", product: "Office chair", status: "delivered", total: 820 },
    { id: 1018, customer: "Elena Silva", product: "Webcam", status: "processing", total: 178 },
    { id: 1019, customer: "Dmitri Okafor", product: "Office chair", status: "new", total: 1230 },
    { id: 1020, customer: "Mei Brown", product: "USB-C cable", status: "processing", total: 45 },
    { id: 1021, customer: "Sofia Martin", product: "Headset", status: "new", total: 238 },
    { id: 1022, customer: "Lucas Chen", product: "Laptop", status: "processing", total: 1290 },
    { id: 1023, customer: "Amira Hassan", product: "Desk lamp", status: "shipped", total: 180 },
    { id: 1024, customer: "Oscar Silva", product: "Keyboard", status: "delivered", total: 237 },
    { id: 1025, customer: "Hana Novak", product: "Monitor", status: "new", total: 680 },
    { id: 1026, customer: "Leo Rossi", product: "Webcam", status: "processing", total: 89 },
    { id: 1027, customer: "Maya Garcia", product: "Office chair", status: "shipped", total: 1230 },
    { id: 1028, customer: "Ivan Larsen", product: "Docking station", status: "delivered", total: 438 },
    { id: 1029, customer: "Nina Tanaka", product: "Mouse", status: "cancelled", total: 195 },
    { id: 1030, customer: "Adam Kowalski", product: "USB-C cable", status: "processing", total: 60 }
  ]
};

$("#surveyElement").Survey({ model: survey });
```

### `src/json.js`

```js
export const json = {
  "showNavigationButtons": false,
  "pages": [
    {
      "name": "orderBrowser",
      "elements": [
        {
          "type": "filter",
          "name": "orderFilter",
          "title": "Filter Orders",
          "targetQuestion": "orders",
          "allowAddPresets": true,
          "presets": [
            {
              "name": "open",
              "title": "Open orders",
              "expression": "{status} anyof ['new', 'processing']"
            },
            {
              "name": "under100",
              "title": "Orders under $100",
              "expression": "{total} < 100"
            },
            {
              "name": "highValue",
              "title": "High-value orders",
              "expression": "{total} >= 500"
            },
            {
              "name": "highValueCancellations",
              "title": "High-value cancellations",
              "expression": "{status} = 'cancelled' and {total} >= 500"
            }
          ]
        },
        {
          "type": "matrixdynamic",
          "name": "orders",
          "title": "Orders",
          "readOnly": true,
          "readOnlyMode": "view",
          "keyName": "id",
          "allowSort": true,
          "showSortBar": "always",
          "pageSize": 5,
          "alternateRows": true,
          "hideColumnsIfEmpty": true,
          "noRowsText": "No orders match your filters.",
          "columns": [
            {
              "name": "id",
              "title": "Order #",
              "cellType": "text",
              "inputType": "number",
              "width": "90px"
            },
            {
              "name": "customer",
              "title": "Customer",
              "cellType": "text"
            },
            {
              "name": "product",
              "title": "Product",
              "cellType": "text"
            },
            {
              "name": "status",
              "title": "Status",
              "choices": [
                {
                  "value": "new",
                  "text": "New"
                },
                {
                  "value": "processing",
                  "text": "Processing"
                },
                {
                  "value": "shipped",
                  "text": "Shipped"
                },
                {
                  "value": "delivered",
                  "text": "Delivered"
                },
                {
                  "value": "cancelled",
                  "text": "Cancelled"
                }
              ]
            },
            {
              "name": "total",
              "title": "Total (USD)",
              "cellType": "text",
              "inputType": "number",
              "width": "125px"
            }
          ]
        }
      ]
    }
  ]
}
;
```

### `src/theme.js`

```js
export const themeJson = {};
```

### `package.json`

```json
{
  "dependencies": {
    "jquery": "latest",
    "survey-core": "latest",
    "survey-js-ui": "latest"
  }
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/form-library/examples/data-grid-view/angular.md)
- [React](https://surveyjs.io/form-library/examples/data-grid-view/reactjs.md)
- [Vue 3](https://surveyjs.io/form-library/examples/data-grid-view/vue3js.md)
- [Vanilla JS](https://surveyjs.io/form-library/examples/data-grid-view/vanillajs.md)
