jspreadsheet CE

repository·master·Indexed 27 days ago

https://github.com/jspreadsheet/ce

A lightweight, vanilla JavaScript framework and plugin for creating interactive web-based data grids with spreadsheet-like controls compatible with Excel and Google Spreadsheets. Version 5.0.4 supports various column types including text, dropdown, calendar, image, checkbox, numeric, and color. It provides official integration packages for React (@jspreadsheet-ce/react), Vue (@jspreadsheet-ce/vue), and Angular, and supports advanced features such as nested headers, cell comments, and toolbar customization.

Tokens
82.1K
Snippets
168
Records
372
Agent score
92%

What's inside jspreadsheet-ce

  1. Overview of Jspreadsheet CE

    master

    Jspreadsheet CE is a lightweight JavaScript spreadsheet component designed to create interactive web-based data grids with spreadsheet-like controls. It is compatible with Excel and Google Sheets, supporting copy-paste functionality between the two.

    Key capabilities include:

    • Embedding spreadsheets using JavaScript arrays, JSON, CSV, or XLSX files.
    • Customizing columns and editors via third-party plugin integrations.
    • Handling complex data inputs with native column types.
    • Building rich CRUD applications with a familiar spreadsheet UI.
  2. Explore related styling tools

    master

    For advanced styling and theming, consider these related resources:

    • CE Themes: Use pre-built themes for Jspreadsheet CE.
    • Jspreadsheet Pro Appearance: Access visual attributes and advanced theming (available in the Pro version).
    • Conditional Formatting: Implement dynamic styling based on cell values (available in the Pro version).
  3. Compare Jspreadsheet CE and Pro Dropdown Features

    master

    Jspreadsheet CE uses the jSuites Dropdown component, which is lightweight and dependency-free. If your project requires advanced data input logic, Jspreadsheet Pro (which uses LemonadeJS Dropdown) provides several enterprise features:

    • Conditional Dropdowns: Options that change dynamically based on other cell values.
    • Dynamic Ranges: Linking dropdowns to specific cell ranges (e.g., Sheet1!A1:A4).
    • Remote Search: Autocomplete functionality powered by backend APIs with JWT support.
    • Enhanced Performance: Up to 3x faster rendering than the CE version.
    • Improved Accessibility: Enhanced ARIA support and keyboard navigation.
  4. Compare Jspreadsheet CE and Pro Editors

    master

    Jspreadsheet CE includes 12 basic editors. Jspreadsheet Pro provides 17 professional editors and advanced capabilities for data-intensive applications.

    Pro-only Advanced Editor Types:

    • Conditional Dropdowns: Options change based on other cell values.
    • Rich Text Editor: Full HTML formatting (bold, italic, lists, etc.).
    • HTML Editor: Embed custom HTML content.
    • Advanced Date/Time: Enhanced calendar with time selection.
    • Rating Editor: Star ratings and custom systems.
    • Tags Editor: Multi-select tags with autocomplete.
    • Progress Bars: Visual indicators in cells.
    • Custom Editors: Full API access for building bespoke editors.

    Pro-only Features:

    • Cell-Level Editors: Define unique editors for individual cells rather than just columns.
    • Programmatic Type Changes: Change cell types dynamically at runtime.
    • Enhanced Validation: Advanced rules with custom messages.
    • Editor Events: Extended lifecycle event system.
  5. Compare Jspreadsheet CE and Pro distributions

    master
    Choose the appropriate Jspreadsheet distribution based on your feature requirements. The CE (Community Edition) is free under the MIT license and provides basic spreadsheet-like formulas, copy/paste, and lazy loading. The Pro (Base and Premium) distributions require a license and offer advanced features like smart loading, advanced filtering, worksheet management, and cell-level definitions.
  6. Compare Jspreadsheet CE and Pro formula capabilities

    master

    Jspreadsheet CE includes basic formulas such as SUM, AVERAGE, and standard arithmetic operations.

    For advanced business applications, Jspreadsheet Pro provides full Excel compatibility, including:

    • Lookup Functions: VLOOKUP, HLOOKUP, INDEX, MATCH, XLOOKUP
    • Conditional Formulas: SUMIF, COUNTIF, AVERAGEIF, SUMIFS, COUNTIFS, IFS
    • Financial Functions: NPV, IRR, PMT, FV, PV, RATE
    • Date/Time Functions: NETWORKDAYS, EDATE, EOMONTH
    • Text Functions: CONCATENATE, TEXTJOIN, REGEX
    • Statistical Functions: STDEV, VAR, PERCENTILE, QUARTILE
    • Advanced Features: Cross-worksheet calculations (e.g., Sheet2!A1:B10), dynamic ranges (e.g., A:A), and array formulas.
  7. Install Jspreadsheet CE via CDN

    master

    Include Jspreadsheet CE and its dependency jsuites directly in your HTML using JSDelivr. You must include both the JavaScript files and the CSS files for the spreadsheet and the suites to render correctly.

    <script src="https://cdn.jsdelivr.net/npm/jspreadsheet-ce@5.0.0-beta.3/dist/index.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jspreadsheet-ce@5.0.0-beta.3/dist/jspreadsheet.min.css" type="text/css" />
    <script src="https://cdn.jsdelivr.net/npm/jsuites/dist/jsuites.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jsuites/dist/jsuites.min.css" type="text/css" />
  8. Use Jspreadsheet CE with Angular

    master

    Integrate Jspreadsheet CE into Angular applications using the jspreadsheet-ce package. Use @ViewChild to get a reference to the container element and initialize the spreadsheet within the ngAfterViewInit lifecycle hook.

    import { Component, ViewChild, ElementRef } from "@angular/core";
    import jspreadsheet from "jspreadsheet-ce";
    import "jspreadsheet-ce/dist/jspreadsheet.css"
    
    // Create component
    @Component({
        standalone: true,
        selector: "app-root",
        template: `<div #spreadsheet></div>`,
    })
    export class AppComponent {
        @ViewChild("spreadsheet") spreadsheet: ElementRef;
        // Worksheets
        worksheets: jspreadsheet.worksheetInstance[];
        // Create a new data grid
        ngAfterViewInit() {
            // Create spreadsheet
            this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
                worksheets: [{
                    data: [
                        ['Hello', 13123, '', 'Yes', true, '#AA4411'],
                        ['World!', 8, '', 'No', false, '#99BE23']
                    ],
                    columns: [
                        { type: 'text', title: 'Text' },
                        { type: 'numeric', title: 'Numeric', mask:'$ #.##,00', decimal: ',' },
                        { type: 'calendar', title: 'Calendar' },
                        { type: 'dropdown', source: ['Yes', 'No', 'Maybe'] },
                        { type: 'checkbox', title: 'Checkbox' },
                        { type: 'color', title: 'Color', width: 50, render: 'square' }
                    ]
                }],
            });
        }
    }