Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ag-grid-enterprise/server-side-row-model

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/server-side-row-model

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

  • 28.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
120K
decreased by-2.29%
Maintainers
3
Weekly downloads
 
Created

What is @ag-grid-enterprise/server-side-row-model?

@ag-grid-enterprise/server-side-row-model is a package that provides advanced data management capabilities for AG Grid, specifically designed for handling large datasets with server-side operations. It allows for efficient data loading, filtering, sorting, and pagination directly from the server, making it ideal for enterprise-level applications.

What are @ag-grid-enterprise/server-side-row-model's main functionalities?

Server-Side Data Loading

This feature allows the grid to load data from a server in chunks, which is useful for handling large datasets. The `getRows` method is called whenever the grid needs more rows, and it fetches data from a server endpoint.

const gridOptions = {
  rowModelType: 'serverSide',
  serverSideDatasource: {
    getRows: (params) => {
      fetch('/api/data', {
        method: 'POST',
        body: JSON.stringify(params.request),
        headers: { 'Content-Type': 'application/json' }
      })
      .then(response => response.json())
      .then(data => params.successCallback(data.rows, data.lastRow))
      .catch(error => params.failCallback());
    }
  }
};

Server-Side Filtering

This feature allows the grid to apply filters on the server side. The `filterModel` is sent to the server, which then returns the filtered data.

const gridOptions = {
  rowModelType: 'serverSide',
  serverSideDatasource: {
    getRows: (params) => {
      const request = {
        ...params.request,
        filterModel: params.request.filterModel
      };
      fetch('/api/data', {
        method: 'POST',
        body: JSON.stringify(request),
        headers: { 'Content-Type': 'application/json' }
      })
      .then(response => response.json())
      .then(data => params.successCallback(data.rows, data.lastRow))
      .catch(error => params.failCallback());
    }
  }
};

Server-Side Sorting

This feature allows the grid to sort data on the server side. The `sortModel` is sent to the server, which then returns the sorted data.

const gridOptions = {
  rowModelType: 'serverSide',
  serverSideDatasource: {
    getRows: (params) => {
      const request = {
        ...params.request,
        sortModel: params.request.sortModel
      };
      fetch('/api/data', {
        method: 'POST',
        body: JSON.stringify(request),
        headers: { 'Content-Type': 'application/json' }
      })
      .then(response => response.json())
      .then(data => params.successCallback(data.rows, data.lastRow))
      .catch(error => params.failCallback());
    }
  }
};

Server-Side Pagination

This feature allows the grid to handle pagination on the server side. The `startRow` and `endRow` parameters are sent to the server, which then returns the appropriate subset of data.

const gridOptions = {
  rowModelType: 'serverSide',
  serverSideDatasource: {
    getRows: (params) => {
      const request = {
        ...params.request,
        startRow: params.request.startRow,
        endRow: params.request.endRow
      };
      fetch('/api/data', {
        method: 'POST',
        body: JSON.stringify(request),
        headers: { 'Content-Type': 'application/json' }
      })
      .then(response => response.json())
      .then(data => params.successCallback(data.rows, data.lastRow))
      .catch(error => params.failCallback());
    }
  }
};

Other packages similar to @ag-grid-enterprise/server-side-row-model

Keywords

FAQs

Package last updated on 02 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc