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

@ag-grid-enterprise/menu

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/menu

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

  • 31.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
171K
increased by1.05%
Maintainers
3
Weekly downloads
 
Created

What is @ag-grid-enterprise/menu?

@ag-grid-enterprise/menu is a package that provides advanced menu functionalities for ag-Grid, a popular JavaScript data grid. It allows users to create custom context menus, column menus, and other interactive menu elements within the grid.

What are @ag-grid-enterprise/menu's main functionalities?

Custom Context Menu

This feature allows you to create a custom context menu that appears when a user right-clicks on a cell. The `onCellContextMenu` event is used to show the popup menu.

const gridOptions = {
  onCellContextMenu: (params) => {
    params.api.showPopupMenu(params.node, params.column, params.event);
  },
  popupParent: document.body,
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ]
};

new agGrid.Grid(document.getElementById('myGrid'), gridOptions);

Column Menu

This feature allows you to add a column menu with tabs for filtering, general options, and column management. The `menuTabs` property in `defaultColDef` is used to specify which tabs to include.

const gridOptions = {
  defaultColDef: {
    menuTabs: ['filterMenuTab', 'generalMenuTab', 'columnsMenuTab']
  },
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ]
};

new agGrid.Grid(document.getElementById('myGrid'), gridOptions);

Custom Menu Items

This feature allows you to add custom items to the context menu. The `getContextMenuItems` function is used to define the items, including built-in options and custom actions.

const gridOptions = {
  getContextMenuItems: (params) => {
    return [
      'copy',
      'copyWithHeaders',
      'paste',
      'separator',
      {
        name: 'Custom Menu Item',
        action: () => { console.log('Custom Menu Item Clicked'); }
      }
    ];
  },
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ]
};

new agGrid.Grid(document.getElementById('myGrid'), gridOptions);

Other packages similar to @ag-grid-enterprise/menu

Keywords

FAQs

Package last updated on 11 Dec 2023

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