### Install Bryntum Grid Package Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm Installs the Bryntum Grid component from Bryntum's private npm registry. Provides both trial and licensed version installation options for version 6.3.3. Requires prior configuration of registry access credentials as documented in the Npm Repository Guide. ```shell npm install @bryntum/grid@npm:@bryntum/grid-trial@6.3.3 ``` ```shell npm install @bryntum/grid@6.3.3 ``` -------------------------------- ### Install Bryntum Grid Trial Version Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Installs the trial version of Bryntum Grid and its React wrapper via npm. Requires prior access setup to Bryntum's private registry. ```shell npm install @bryntum/grid@npm:@bryntum/grid-trial @bryntum/grid-react ``` -------------------------------- ### Start local development server with Vite (shell) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/guide Installs project dependencies and launches the development server using Vite. Use the default `start` script if available, otherwise run the `dev` script. The server is reachable at http://localhost:5173 and supports hot-reloading. ```shell npm install npm start ``` ```shell npm install npm run dev ``` -------------------------------- ### Install project dependencies Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Installs required node modules including sass for styling support. Must be run after project creation. ```shell cd bryntum-grid-app npm install && npm install sass ``` -------------------------------- ### Install Bryntum Grid packages Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Adds Bryntum Grid and React integration packages to the project. Choose either trial or licensed version based on your access. ```shell npm install @bryntum/grid@npm:@bryntum/grid-trial @bryntum/grid-react ``` ```shell npm install @bryntum/grid @bryntum/grid-react ``` -------------------------------- ### Configure Bryntum Grid HintFlow for Onboarding Tutorials Source: https://bryntum.com/products/grid/docs-llm/api/Core/widget/Hint Demonstrates how to instantiate and configure the HintFlow class to create a multi-step onboarding tutorial. It includes default configurations and specific hint setups with target elements, actions, and display properties. This is the core example for implementing guided user experiences. ```javascript new HintFlow({ // Default configs to apply to all hints defaults : { modal : true }, hints : [{ // CSS selector to find the target element target : '.b-tabpanel-tab[data-item-index="1"]', // Action to take when the 'Next' button is clicked nextAction : { click : '.b-tabpanel-tab[data-item-index="1"]' }, // Config props for the displayed Hint popup title : 'Change tab', content : 'Click here to move to the next tab', align : 't-n' }, { target : '.b-button:contains(Save)', title : 'Save', content : 'Click here to save the changes', nextAction : { click : '.b-button:contains(Save)' } }] }); ``` -------------------------------- ### Install npm Dependencies Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm Changes to the project directory and installs all required npm dependencies listed in package.json. This essential step must be executed after project creation to download and configure the project's dependency tree before proceeding with Bryntum Grid integration. ```shell cd my-grid-app npm install ``` -------------------------------- ### Navigate to Project Directory Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Change current directory to the newly created Next.js project folder to proceed with further setup. ```shell cd bryntum-grid ``` -------------------------------- ### Install Bryntum Grid Licensed Version Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Installs the licensed version of Bryntum Grid and its React wrapper. Assumes proper npm configuration for access to Bryntum packages. ```shell npm install @bryntum/grid @bryntum/grid-react ``` -------------------------------- ### Initialize Bryntum Grid in JavaScript Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm Creates and configures a Bryntum Grid instance with inline sample data and column definitions. Imports the Grid class from @bryntum/grid and appends it to the DOM element with id 'app'. Demonstrates basic grid setup with name and city fields, including width and flex column configuration. ```javascript import { Grid } from '@bryntum/grid'; import './style.css'; const grid = new Grid({ appendTo : 'app', columns : [ { field : 'name', text : 'Name', width : 200 }, { field : 'city', text : 'City', flex : 1 } ], data : [ { name : 'Dan Stevenson', city : 'Los Angeles' }, { name : 'Talisha Babin', city : 'Paris' } ] }); ``` -------------------------------- ### Install Remix Utilities for Client-Side Rendering Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Installs the 'remix-utils' package, which is necessary for enabling client-side rendering in the Remix application. ```shell npm install remix-utils ``` -------------------------------- ### Install and Run Local Bryntum Grid Vue Demos Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/vue/guide Commands to install npm dependencies and start a local development server for Bryntum Grid Vue demos. The server is accessible at http://127.0.0.1:8080 and supports hot-reloading for immediate feedback on code changes. ```shell npm install npm run start ``` -------------------------------- ### Create Remix Application Shell Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Command to create a new Remix application using npx. It prompts for project name, git initialization, and dependency installation. ```shell npx create-remix@latest ``` -------------------------------- ### Install and Run Bryntum Grid Local Demos (Shell) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/ionic/guide Commands to install dependencies and start a local development server for Bryntum Grid Ionic demos. The server is accessible at http://localhost:4200 and automatically rebuilds on code changes. Useful for immediate feedback during development. ```shell npm install npm run start ``` -------------------------------- ### Install @bryntum/grid-thin-trial Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/multiple-products Demonstrates how to install the trial version of the Bryntum Grid component package using npm. Requires aliasing the package name during installation. This example shows installation and adding to the 'dependencies' section of the `package.json` file. ```shell npm install @bryntum/grid-thin@npm:@bryntum/grid-thin-trial@6.3.3 ``` ```json "dependencies": { "@bryntum/grid-thin": "npm:@bryntum/grid-thin-trial@6.3.3" } ``` -------------------------------- ### Run Development Server Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Command to start the local development server for the Next.js application. This allows you to view the integrated Bryntum Grid in your browser. ```shell npm run dev ``` -------------------------------- ### Running Node.js Development Server Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/migration/migrate-from-ag-grid-to-bryntum Starts the local development server using npm script after setup. Requires package.json with dev script (e.g., nodemon). Inputs none; outputs running server at localhost:1338 with AG Grid data. Limitation: Assumes all dependencies installed and database connected. ```bash npm run dev ``` -------------------------------- ### Install Bryntum Grid Packages for Vue 3 Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/vue-3 These commands install the necessary Bryntum Grid and Bryntum Grid Vue 3 packages for a Vue 3 application. One command is for the trial version, and the other is for the licensed version, both specifying version 6.3.3. ```shell npm install @bryntum/grid@npm:@bryntum/grid-trial@6.3.3 @bryntum/grid-vue-3@6.3.3 ``` ```shell npm install @bryntum/grid@6.3.3 @bryntum/grid-vue-3@6.3.3 ``` -------------------------------- ### Loading Sample Data into MySQL Database using Bash and SQL Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/migration/migrate-from-ag-grid-to-bryntum This snippet demonstrates populating the MySQL sample_data database with Olympic winners data from an SQL file via command line. It requires MySQL installed and running, with root access. Inputs include the SQL file path; outputs are loaded tables viewable in MySQL Workbench. Limitation: Path must be adjusted for the user's environment and may require PATH setup for mysql executable. ```bash mysql -u root -p -D sample_data < "C:/Users/path to your project/ag-grid-to-bryntum-grid-starter/data/olympic_winners.sql" ``` ```sql USE sample_data; ``` ```sql SELECT * FROM olympic_winners ORDER BY country ASC; ``` -------------------------------- ### Update package.json dependencies Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Specifies exact versions for dependencies to maintain control over upgrades. Different configurations for trial and licensed versions. ```json "dependencies": { "@bryntum/grid": "npm:@bryntum/grid-trial@6.3.3", "@bryntum/grid-react": "6.3.3", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { "@types/react": "~18.2.14", "@types/react-dom": "~18.2.6", "@vitejs/plugin-react": "~4.0.1", "postinstall": "~0.7.4", "sass": "~1.69.6", "typescript": "~5.1.6", "vite": "~4.4.5" } ``` ```json "dependencies": { "@bryntum/grid": "6.3.3", "@bryntum/grid-react": "6.3.3", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { "@types/react": "~18.2.14", "@types/react-dom": "~18.2.6", "@vitejs/plugin-react": "~4.0.1", "postinstall": "~0.7.4", "sass": "~1.69.6", "typescript": "~5.1.6", "vite": "~4.4.5" } ``` -------------------------------- ### Create React project with Vite template Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Initializes a new React project using Vite with either JavaScript or TypeScript templates. Requires Node.js 20 or higher. ```shell npm create vite@latest bryntum-grid-app -- --template react ``` ```shell npm create vite@latest bryntum-grid-app -- --template react-ts ``` -------------------------------- ### Bryntum Grid React Configuration in AppConfig.js Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/guide Shows an example of defining configuration properties for the Bryntum Grid component in a separate AppConfig.js file. This includes setting a tooltip for the grid. ```javascript export const gridProps = { tooltip : "My cool Bryntum Grid component", // Bryntum Grid config options }; ``` -------------------------------- ### Initialize Bryntum Gantt in TypeScript Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/javascript/multiple-products This example demonstrates initialization of a Bryntum Gantt component utilizing the `@bryntum/gantt-thin` package. It defines start and end dates and tasks with dependencies. ```typescript import { Gantt } from '@bryntum/gantt-thin'; import './style.css'; const gantt = new Gantt({ appendTo : 'app', startDate : new Date(2022, 0, 1), endDate : new Date(2022, 0, 10), columns : [ { type : 'name', width : 160 } ], project : { tasks : [ { id : 1, name : 'Write docs', expanded : true, children : [ { id : 2, name : 'Proof-read docs', startDate : '2022-01-02', endDate : '2022-01-09' }, { id : 3, name : 'Release docs', startDate : '2022-01-09', endDate : '2022-01-10' } ] } ], dependencies : [ { fromTask : 2, toTask : 3 } ] } }); ``` -------------------------------- ### Create Vite JavaScript Application Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm Initializes a new Vite project with vanilla JavaScript template using npm create command. This generates a boilerplate application structure named 'my-grid-app' with Vite's build tooling configured. Requires npm 7+ with extra double-dash syntax for passing arguments. ```shell npm create vite@latest my-grid-app -- --template vanilla ``` -------------------------------- ### Install Bryntum Angular Framework Wrapper Packages in JSON Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/ionic/multiple-products Installs the thin Angular wrapper packages for specific Bryntum products, enabling integration into Angular applications. This JSON object is placed in package.json dependencies and requires npm or yarn for installation. Depends on the corresponding API packages and Angular framework setup; outputs configured wrappers in node_modules. ```json { "dependencies": { "@bryntum/core-angular-thin": "6.3.3", "@bryntum/gantt-angular-thin": "6.3.3" } } ``` ```json { "dependencies": { "@bryntum/core-angular-thin": "6.3.3", "@bryntum/calendar-angular-thin": "6.3.3" } } ``` ```json { "dependencies": { "@bryntum/core-angular-thin": "6.3.3", "@bryntum/taskboard-angular-thin": "6.3.3" } } ``` -------------------------------- ### Create Next.js Application Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Command to scaffold a new Next.js application using create-next-app. Allows selection of project features such as TypeScript, ESLint, and App Router. ```shell npx create-next-app@latest ``` -------------------------------- ### Install Bryntum Thin Trial Package with Alias Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/vue/multiple-products Install thin trial packages by aliasing them using npm install command or direct package.json entry. Requires npm installed and project set up. Inputs: Package name and version. Outputs: Installed packages. Limitations: Applicable to trial packages only; for licensed use purchased packages. ```shell npm install @bryntum/grid-thin@npm:@bryntum/grid-thin-trial@6.3.3 ``` ```json "dependencies": { "@bryntum/grid-thin": "npm:@bryntum/grid-thin-trial@6.3.3", } ``` -------------------------------- ### Framework Wrapper Packages Dependencies Example Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/multiple-products Shows an example of Framework Wrapper packages dependencies included in the `package.json` file. Core React and Scheduler React dependencies are included in the example. ```json { "dependencies": { "@bryntum/core-react-thin": "6.3.3", "@bryntum/scheduler-react-thin": "6.3.3" } } ``` -------------------------------- ### Initialize Bryntum Scheduler in TypeScript Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/javascript/multiple-products This example shows how to set up a basic Bryntum Scheduler. It uses the `@bryntum/scheduler-thin` package and defines a start and end date for the scheduler. The scheduler displays resources and events. ```typescript import { Scheduler } from '@bryntum/scheduler-thin'; import './style.css'; const scheduler = new Scheduler({ appendTo : 'app', startDate : new Date(2022, 0, 1), endDate : new Date(2022, 0, 10), columns : [ { text : 'Name', field : 'name', width : 160 } ], resources : [ { id : 1, name : 'Dan Stevenson' }, { id : 2, name : 'Talisha Babin' } ], events : [ { resourceId : 1, startDate : '2022-01-01', endDate : '2022-01-10' }, { resourceId : 2, startDate : '2022-01-02', endDate : '2022-01-09' } ] }); ``` -------------------------------- ### Run Django Development Server Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/backends/django-rest-framework/guide This command starts the Django development server, allowing you to preview the application and interact with the Bryntum Grid. It requires Python and Django to be installed. ```sh python manage.py runserver localhost:8000 ``` -------------------------------- ### Run Ionic Application Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/ionic Command to start the Ionic development server for local testing. Requires Ionic CLI to be installed globally. ```shell ionic serve ``` -------------------------------- ### Run Angular development server for Bryntum Grid app Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/angular Starts the Angular CLI development server, compiling the project and serving it at http://localhost:4200. Execute the command from the project root in a terminal. No additional dependencies beyond Angular CLI are required. ```Shell ng serve ``` -------------------------------- ### Initialize Grid with Existing Store Instance (Vue 3 Composition API) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/data/displayingdata This Vue 3 Composition API example shows creating a `Store` instance within the `setup` function and returning it. This pre-configured store can then be used by a Bryntum Grid component. ```javascript export default { setup() { const myStore = new Store({ someConfig : "...", data : [ { id : 1, name : 'Batman' }, /*...*/ ] }); return { store : myStore }; } } ``` -------------------------------- ### Setup StateProvider with default local storage Source: https://bryntum.com/products/grid/docs-llm/api/Core/state/StateProvider Initializes the global StateProvider to use the browser's localStorage with the default prefix. This allows all stateful components to automatically save and restore their state. No additional parameters are required. ```JavaScript StateProvider.setup('local'); ``` -------------------------------- ### Create Store with Data - JavaScript Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/data/storebasics Creates a Store instance with an array of data records, each containing id, name, and powers. This example serves as the basis for further operations like sorting or filtering. Requires the Store class from Bryntum Grid library. No specific inputs beyond data array; outputs a Store object for use with Grid components. Assumes data is static and well-formed. ```javascript const store = new Store({ data : [ { id : 1, name : 'Ms. Marvel', powers : 'Shapeshifting' }, { id : 2, name : 'Black Widow', powers : 'Martial arts' }, { id : 3, name : 'Captain Marvel', powers : 'Energy projection' }, { id : 4, name : 'X-23', powers : 'Regeneration' }, { id : 5, name : 'Mockingbird', powers : 'Martial arts' } ] }); ``` -------------------------------- ### Install Thin Trial Package with Alias (npm) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/angular/multiple-products Demonstrates how to install a thin trial package, such as Bryntum Grid, by aliasing it to a standard thin package name using npm. This is required when using framework wrappers with trial versions. ```shell npm install @bryntum/grid-thin@npm:@bryntum/grid-thin-trial@6.3.3 ``` -------------------------------- ### Configure Postinstall Script for Theme Files Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/guide Add a postinstall script in package.json to copy theme CSS and fonts to public/themes automatically. This supports BryntumThemeCombo by making themes accessible. Install the postinstall package as a dev dependency using npm. ```json { "scripts": { "postinstall": "postinstall" }, "postinstall": { "node_modules/@bryntum/grid/*.css*": "copy public/themes/", "node_modules/@bryntum/grid/fonts": "copy public/themes/fonts" }, "devDependencies": { "postinstall": "~0.7.0" } } ``` -------------------------------- ### Import Bryntum Grid Stockholm Theme Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm Imports the Stockholm theme CSS file directly from the node_modules folder for Bryntum Grid styling. Replaces existing styles in style.css to apply the Stockholm visual theme. For production use, consider configuring your build tool to handle CSS imports more robustly than direct node_modules referencing. ```css @import "./node_modules/@bryntum/grid/grid.stockholm.css"; ``` -------------------------------- ### Setup StateProvider with memory storage for server sync Source: https://bryntum.com/products/grid/docs-llm/api/Core/state/StateProvider Initializes the StateProvider to keep state data in memory, allowing developers to load and save state to a backend server. Suitable for scenarios where state must be shared across devices or persisted beyond the browser session. Requires manual handling of the save event to persist changes. ```JavaScript StateProvider.setup('memory'); ``` -------------------------------- ### Install Sass for SCSS Theme Support Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/vue-3 To use the SCSS version of Bryntum Grid themes or customize existing themes, you need to install the `sass` package. This command installs a specific version of Sass as a development dependency. ```shell npm install sass@1.42.0 --save-dev --save-prefix=~ ``` -------------------------------- ### Create Vue 3 Application using Vue CLI Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/vue-3 This command initiates the creation of a new Vue.js 3 project using the official Vue CLI scaffolding tool. It prompts the user for various project configurations like TypeScript, Vue Router, Pinia, and testing support. ```shell npm create vue@latest ``` -------------------------------- ### Install Bryntum Thin API Packages in JSON Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/ionic/multiple-products Installs the thin API packages for Bryntum products such as Grid, Scheduler, Scheduler Pro, Gantt, Calendar, and TaskBoard. This JSON object can be added to package.json dependencies for npm or yarn installation. Requires Node.js environment and may have version compatibility limitations based on Bryntum product versions. ```json { "dependencies": { "@bryntum/core-thin": "6.3.3", "@bryntum/engine-thin": "6.3.3", "@bryntum/grid-thin": "6.3.3", "@bryntum/scheduler-thin": "6.3.3", "@bryntum/schedulerpro-thin": "6.3.3", "@bryntum/gantt-thin": "6.3.3" } } ``` ```json { "dependencies": { "@bryntum/core-thin": "6.3.3", "@bryntum/engine-thin": "6.3.3", "@bryntum/grid-thin": "6.3.3", "@bryntum/scheduler-thin": "6.3.3", "@bryntum/calendar-thin": "6.3.3" } } ``` ```json { "dependencies": { "@bryntum/core-thin": "6.3.3", "@bryntum/engine-thin": "6.3.3", "@bryntum/taskboard-thin": "6.3.3" } } ``` -------------------------------- ### Sizing Bryntum Grid with CSS Layout Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript-npm This CSS configures the app container to full viewport height using flexbox, ensuring the Grid component takes 100% width and appropriate height. It targets an element with id 'app' and sets base font size. Adapt for specific layouts; requires no external dependencies beyond browser CSS support. ```css #app { margin : 0; display : flex; flex-direction : column; height : 100vh; font-size : 14px; } ``` -------------------------------- ### Framework Wrapper Packages Dependencies Example (Extended) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/react/multiple-products Demonstrates framework wrapper packages like Core React, Gantt React, and Scheduler Pro React within a `package.json` file. It showcases the dependencies for a React application utilizing Bryntum components. ```json { "dependencies": { "@bryntum/core-react-thin": "6.3.3", "@bryntum/gantt-react-thin": "6.3.3", "@bryntum/schedulerpro-react-thin": "6.3.3" } } ``` -------------------------------- ### Import Bryntum Grid Theme (CSS) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/vue-3 This snippet shows how to import a Bryntum Grid theme using CSS in a Vue.js application. Ensure the `@bryntum/grid` package is installed. This CSS file is necessary for the grid to render correctly. ```css @import "@bryntum/grid/grid.stockholm.css"; ``` -------------------------------- ### Basic HTML Structure for Grid App Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript Sets up the basic HTML structure for a Bryntum Grid application. Includes references to main.js and style.css. Requires a DOM element with id 'app' for grid mounting. ```html
``` -------------------------------- ### Configure AjaxStore in Vue Setup Function (JavaScript) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/data/displayingdata Demonstrates how to set up an AjaxStore within the `setup` function of a Vue.js component. The store is made available as a return value, suitable for template usage. ```javascript export default { setup() { const myStore = new AjaxStore({ readUrl : 'backend/load.aspx' }); return { store : myStore }; } } ``` -------------------------------- ### Bryntum Grid: Configure Week Start Day Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/customization/localization Change the default week start day by configuring the `weekStartDay` property of the `DateHelper` class. Accepts values from 0 (Sunday) to 6 (Saturday). ```javascript const locale = { DateHelper : { weekStartDay : 1 // 0-6 (0: Sunday, 1: Monday etc.) } } ``` -------------------------------- ### JavaScript Locale Object Example Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/customization/localization An example of a JavaScript object representing a locale in Bryntum Grid. It includes locale name, description, code, and translations for various components like DateField, DatePicker, and NumberFormat. ```javascript const locale = { localeName : 'En', localeDesc : 'English (US)', localeCode : 'en-US', DateField : { invalidDate : 'Invalid date input' }, DatePicker : { gotoPrevYear : 'Go to previous year', gotoPrevMonth : 'Go to previous month', gotoNextMonth : 'Go to next month', gotoNextYear : 'Go to next year' }, NumberFormat : { locale : 'en-US', currency : 'USD' }, ... } ``` -------------------------------- ### Install Bryntum Grid Trial with npm for Angular Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/npm-repository Installs the Bryntum Grid trial package with an alias for npm, and the Angular wrapper. It's recommended to use `--save-exact` for precise version control. ```shell npm install @bryntum/grid@npm:@bryntum/grid-trial@6.3.3 npm install @bryntum/grid-angular@6.3.3 ``` -------------------------------- ### Installing dotenv Package in Node.js Backend Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/migration/migrate-from-ag-grid-to-bryntum Installs the dotenv module to load environment variables from a .env file into the Node.js application. Requires npm package manager. Purpose is to securely manage database credentials without hardcoding. No inputs/outputs beyond installation; limitation: must run in project root. ```bash npm install dotenv ``` -------------------------------- ### Basic Panel Initialization with Title and HTML Source: https://bryntum.com/products/grid/docs-llm/api/Core/widget/Panel A simple example of initializing a Panel with a title and basic HTML content, demonstrating the fundamental structure of a Panel configuration. ```javascript new Panel({ title : 'Test', html : 'Panel strip test', strips : { left : { dock : 'left', items : { go : { text : 'Go' } } } } }); ``` -------------------------------- ### ConfirmationBar Widget Configuration Examples (JavaScript) Source: https://bryntum.com/products/grid/docs-llm/api/Core/widget/ConfirmationBar Illustrates various configuration options for the ConfirmationBar widget in JavaScript. This includes setting the default button, controlling button width synchronization, and defining custom key mappings. ```javascript // Example with default button and syncWidthButtons disabled const confirmationBar = new ConfirmationBar({ defaultButton : 'ok', syncWidthButtons : false, items : 'ok,cancel' }); // Example with keyMap customization (though default maps Enter/Escape) const customKeyMapBar = new ConfirmationBar({ keyMap : { // Default Enter/Escape mappings are already handled // You can add more custom mappings here if needed }, items : 'yes,no' }); ``` -------------------------------- ### Set up Angular App HTML for Bryntum Grid Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/angular Provides the HTML template structure for the Angular application to render the Bryntum Grid. This file (`app.html`) typically contains the necessary element to host the grid component. The provided snippet is empty, implying that the grid component is likely managed and rendered programmatically or via directives within the Angular component itself. ```html ``` -------------------------------- ### Configure Specific Resize Handles Source: https://bryntum.com/products/grid/docs-llm/api/Core/widget/mixin/Resizable Shows how to configure resizable handles for specific edges. In this example, only start and bottom edges are enabled for resizing while others are disabled. ```javascript // Resizable with only start and bottom edges active new SomePopup({ resizable : { handles : { top : false, end : false, bottom : true, start : true, // corners also available: topStart, topEnd, bottomStart, bottomEnd // all omitted properties default to `true` if unspecified } } }); ``` -------------------------------- ### Create Bryntum Grid with ES Module Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/javascript Imports and initializes the Bryntum Grid using an EcmaScript module bundle. Requires grid.module.js in the project root. Provides basic grid configuration with columns and sample data. ```javascript import { Grid } from './grid.module.js'; const grid = new Grid({ appendTo : 'app', columns : [ { field : 'name', text : 'Name', width : 200 }, { field : 'city', text : 'City', flex : 1 } ], data : [ { name : 'Dan Stevenson', city : 'Los Angeles' }, { name : 'Talisha Babin', city : 'Paris' } ] }); ``` -------------------------------- ### Initialize Store with Plugins (JavaScript) Source: https://bryntum.com/products/grid/docs-llm/api/Core/mixin/Pluggable Demonstrates how to instantiate a Store with an array of plugin classes. This is a common pattern when integrating plugins with Bryntum components. ```javascript new Store({ plugins: [PluginClass, ...] }); ``` -------------------------------- ### Define Grid Configuration Data Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Creates a grid configuration object with sample user data. This object is used to configure the Bryntum Grid component with predefined data entries. ```javascript const gridProps = { data: [ { id: 11, name: "Doug K Jackson", firstName: "Doug", surName: "Jackson", city: "Barcelona", team: "Dubai Cats", age: 16, food: "Fish n chips", color: "Red" }, { id: 12, name: "James L Ewans", firstName: "James", surName: "Ewans", city: "Dubai", team: "Dubai Dogs", age: 30, food: "Salad", color: "Black" }, { id: 13, name: "Jenny M Brown", firstName: "Jenny", surName: "Brown", city: "Dubai", team: "Stockholm Eagles", age: 56, food: "Waffles", color: "Orange" }, { id: 14, name: "Doug N Ewans", firstName: "Doug", surName: "Ewans", city: "Barcelona", team: "New York Dogs", age: 61, food: "Pancake", color: "Teal" }, { id: 15, name: "Mike O Ewans", firstName: "Mike", surName: "Ewans", city: "Stockholm", team: "New York Roosters", age: 78, food: "Burger", color: "Green" } ] }; export { gridProps }; ``` -------------------------------- ### Initialize Empty Bryntum Grid Instance Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/tutorial Creates a basic Bryntum Grid instance and appends it to the DOM element with id 'app'. Imports the Grid class from the module bundle and configures it with minimal settings. The grid will render but appear empty without column and data configuration. ```javascript import { Grid } from './grid.module.js'; const grid = new Grid({ appendTo: 'app' }); ``` -------------------------------- ### Create and Run a New Ionic App (Shell) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/ionic/guide Commands to create a new Ionic application using the 'blank' starter template and then serve it locally for development. This sets up a basic project structure that can be further customized. ```shell ionic start IonicApp blank cd IonicApp ionic serve ``` -------------------------------- ### Bryntum Grid Configuration in TypeScript Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Defines the configuration for a Bryntum Grid component in TypeScript, including column definitions and sample data. The 'renderer' function customizes cell appearance. ```typescript import { BryntumGridProps } from "@bryntum/grid-react"; const gridProps: BryntumGridProps = { columns: [ { text: "Name", field: "name", flex: 2 }, { text: "Age", field: "age", width: 100, type: "number" }, { text: "City", field: "city", flex: 1 }, { text: "Food", field: "food", flex: 1 }, { text: "Color", field: "color", flex: 1, renderer({ cellElement, value, }: { cellElement: HTMLElement; value: string; }) { // set the color based on the value (e.g. "Red" should be red) cellElement.style.color = value; return value; }, }, ], data: [ { id: 1, name: "Don A Taylor", firstName: "Don", surName: "Taylor", city: "Dubai", team: "Paris Tigers", age: 30, food: "Salad", color: "Black" }, { id: 2, name: "John B Adams", firstName: "John", surName: "Adams", city: "Paris", team: "Washington Horses", age: 64, food: "Bolognese", color: "Orange" }, { id: 3, name: "Doug C Jones", firstName: "Doug", surName: "Jones", city: "Stockholm", team: "New York Hens", age: 30, food: "Pancake", color: "Pink" }, { id: 4, name: "James D Davis", firstName: "James", surName: "Davis", city: "Barcelona", team: "Dubai Lions", age: 87, food: "Pancake", color: "Green" }, { id: 5, name: "Mike E Johnson", firstName: "Mike", surName: "Johnson", city: "Dubai", team: "New York Roosters", age: 14, food: "Pancake", color: "Green" }, { id: 6, name: "Don F Johnson", firstName: "Don", surName: "Johnson", city: "Dubai", team: "Paris Tigers", age: 18, food: "Fish n chips", color: "Red" }, { id: 7, name: "Jane G McGregor", firstName: "Jane", surName: "McGregor", city: "Stockholm", team: "Dubai Eagles", age: 78, food: "Fish n chips", color: "Green" }, { id: 8, name: "Jane H Thomas", firstName: "Jane", surName: "Thomas", city: "New York", team: "Paris Cougars", age: 65, food: "Fish n chips", color: "Black" }, { id: 9, name: "Lisa I Anderson", firstName: "Lisa", surName: "Anderson", city: "New York", team: "Stockholm Tigers", age: 14, food: "Burger", color: "Orange" }, { id: 10, name: "Don J Thomas", firstName: "Don", surName: "Thomas", city: "Stockholm", team: "Barcelona Cougars", age: 45, food: "Salad", color: "Black" }, { id: 11, ], }; ``` -------------------------------- ### Configure Column Header Widgets Source: https://bryntum.com/products/grid/docs-llm/api/Grid/column/Column Adds interactive widgets to a column header. This example demonstrates adding a button to insert a new row and start editing it. It uses async functions for interaction. ```javascript { text : 'Name', field : 'name', flex : 1, headerWidgets : [ { type : 'button', text : 'Add row', cls : 'b-raised b-blue', async onAction() { const grid = this.owner.grid, [newRecord] = grid.store.add({ name : 'New user' }); await grid.scrollRowIntoView(newRecord); await grid.features.cellEdit.startEditing({ record : newRecord, field : 'name' }); } } ] } ``` -------------------------------- ### Apply Bryntum Grid Styling (SCSS) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Sets up the styling for the Bryntum Grid by importing the Stockholm theme and setting the height of the root element. This ensures proper display and layout of the grid. ```scss // import bryntum theme @import "@bryntum/grid/grid.stockholm.css"; // Giving our grid some height #root { height: 100vh; } ``` -------------------------------- ### Update Page Component (app/page.tsx) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/nextjs Replaces the content of `app/page.tsx` to render the `GridWrapper` component and import necessary CSS styles for the Bryntum Grid. This sets up the main page to display the grid. ```typescript import { GridWrapper } from "@/app/components/GridWrapper"; import "@bryntum/grid/grid.stockholm.css"; import styles from "./page.module.css"; export default function Home() { return (
); } ``` -------------------------------- ### Create and Configure a Basic Popup Source: https://bryntum.com/products/grid/docs-llm/api/Core/widget/Popup Demonstrates how to create a new Popup instance, attach it to an element, and define its content using an items configuration object. The example shows adding text input and a button widget. ```javascript const popup = new Popup({ forElement: document.querySelector('button'), items: { text: { type: 'text', placeholder: 'Text' }, button: { type: 'button', text: 'Okay', style: 'width: 100%', color: 'b-orange' } } }); ``` -------------------------------- ### Get First and Last Records in Store Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/data/storebasics Shows shortcuts to access the first and last records in a Store without needing to know their indices. These properties provide quick access to boundary records in the collection. ```javascript store.first; // Ms. Marvel store.last; // Mockingbird ``` -------------------------------- ### Build Production Version of Bryntum Grid Vue Demos Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/vue/guide Command to install npm dependencies and build the production-ready version of the Bryntum Grid Vue application. This command is used for deployment purposes. ```shell npm install npm run build ``` -------------------------------- ### Combining Bryntum Grid and Scheduler (JavaScript) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/integration/javascript/multiple-products Provides an example of how to integrate and use both Bryntum Grid and Scheduler products on the same web page. It includes importing the necessary components, initializing both widgets, and configuring their basic properties and data. ```javascript import { Grid } from "@bryntum/grid-thin"; import { Scheduler } from "@bryntum/scheduler-thin"; import "./style.css"; // import styles const grid = new Grid({ appendTo: "app", columns: [ { field: "name", text: "Name", width: 200 }, { field: "city", text: "City", flex: 1 }, ], data: [ { name: "Dan Stevenson", city: "Los Angeles" }, { name: "Talisha Babin", city: "Paris" }, ], }); const scheduler = new Scheduler({ appendTo: "app", startDate: new Date(2022, 0, 1), endDate: new Date(2022, 0, 10), columns: [{ text: "Name", field: "name", width: 160 }], resources: [ { id: 1, name: "Dan Stevenson" }, { id: 2, name: "Talisha Babin" }, ], events: [ { resourceId: 1, startDate: "2022-01-01", endDate: "2022-01-10" }, { resourceId: 2, startDate: "2022-01-02", endDate: "2022-01-09" }, ], }); ``` -------------------------------- ### Style Application with CSS Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Applies basic styling to the application including full viewport height layout and custom font settings. Imports Bryntum's Stockholm theme for grid styling. ```css body, html { margin: 0; display: flex; flex-direction: column; height: 100vh; font-family: Poppins, "Open Sans", Helvetica, Arial, sans-serif; font-size: 14px; } ``` -------------------------------- ### Create Bryntum Grid React Component Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react-remix Creates a client-side React component that renders the Bryntum Grid using the configuration data. Uses .client.tsx extension for client-side rendering in Remix framework. ```typescript import { BryntumGrid } from '@bryntum/grid-react'; import { gridProps } from './app.config'; const BryntumClient = () => { return ( ); }; export default BryntumClient; ``` -------------------------------- ### Integrate Bryntum Grid in React App (JavaScript) Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/quick-start/react Renders the Bryntum Grid component within a React application. It imports the BryntumGrid component and the grid configuration, and includes basic SCSS styling. ```javascript import { BryntumGrid } from '@bryntum/grid-react'; import { gridProps } from './GridConfig'; import './App.scss'; function App() { return ( ); } export default App; ``` -------------------------------- ### Decade Calculation Function Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/customization/localization A JavaScript function to calculate the decade for a given year or date object. It returns the year minus the remainder when divided by 10, effectively giving the start of the decade (e.g., '2020s'). ```javascript decade : date => { const year = typeof date === 'number' ? date : date.getFullYear(); return `${year - (year % 10)}s`; } ``` -------------------------------- ### Bryntum Grid: Full English (US) Locale Definition Source: https://bryntum.com/products/grid/docs-llm/guide/Grid/customization/localization A comprehensive example of a full locale definition for Bryntum Grid in English (US). This includes translations for various UI components and common terms. ```javascript const emptyString = new String(); const locale = { localeName : 'En', localeDesc : 'English (US)', localeCode : 'en-US', localeRtl : false, Object : { Yes : 'Yes', No : 'No', Cancel : 'Cancel', Ok : 'OK', Week : 'Week', None : 'None', previous : 'Previous', next : 'Next', to : 'to', at : 'At', on : 'On', editing : what => `Editing ${what}`, settings : 'Settings', close : 'Close', go : 'Go', save : 'Save', cancel : 'Cancel', revert : 'Revert', collapse : 'Collapse', expand : 'Expand', today : 'Today' }, CheckboxGroup : { wrongNbrOfOptionsSelected : min => `Select exactly ${min}`, tooFewOptionsSelected : min => `Select at least ${min}`, tooManyOptionsSelected : max => `Select no more than ${max}` }, CodeEditor : { apply : 'Apply', autoApply : 'Auto apply', downloadCode : 'Download code', editor : 'Code editor', viewer : 'Code viewer' }, ColorPicker : { noColor : 'No color' }, Combo : { noResults : 'No results', recordNotCommitted : 'Record could not be added', addNewValue : value => `Add ${value}` }, FilePicker : { file : 'File' }, Field : { badInput : 'Invalid field value', patternMismatch : 'Value should match a specific pattern', rangeOverflow : value => `Value must be less than or equal to ${value.max}`, rangeUnderflow : value => `Value must be greater than or equal to ${value.min}`, stepMismatch : 'Value should fit the step', tooLong : 'Value should be shorter', tooShort : 'Value should be longer', typeMismatch : 'Value is required to be in a special format', valueMissing : 'This field is required', invalidValue : 'Invalid field value', minimumValueViolation : 'Minimum value violation', maximumValueViolation : 'Maximum value violation', fieldRequired : 'This field is required', validateFilter : 'Value must be selected from the list' }, DateField : { invalidDate : format => 'Invalid' } } ``` -------------------------------- ### Initialize HintFlow with Hints and Defaults Source: https://bryntum.com/products/grid/docs-llm/api/Core/util/HintFlow Demonstrates how to initialize the HintFlow class with default configurations and an array of hint definitions. Each hint specifies a target element, content, title, and a next action. Defaults can include properties like 'modal' to apply to all hints. ```javascript new HintFlow({ // Default configs to apply to all hints defaults: { modal: true }, hints: [ { // CSS selector to find the target element target: '.b-tabpanel-tab[data-item-index="1"]', // Action to take when the 'Next' button is clicked nextAction: { click: '.b-tabpanel-tab[data-item-index="1"]' }, // Config props for the displayed Hint popup title: 'Change tab', content: 'Click here to move to the next tab', align: 't-n' }, { target: '.b-tabpanel .b-tabpanel-body :nth-child(2) input', title: 'Change name', content: 'Enter the new name here', nextAction: { text: 'New name[Enter]' } }, { target: '.b-button:contains(Save)', title: 'Save', content: 'Click here to save the changes', nextAction: { click: '.b-button:contains(Save)' } } ] }); ```