|
1 | | -# datagrid |
| 1 | +# ngbootstrap |
2 | 2 |
|
3 | | -This library was generated with [Nx](https://nx.dev). |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +**ngbootstrap** is a custom Angular UI component library designed to provide high-quality, reusable, and accessible components. |
| 8 | +The first package in the library is `@ngbootstrap/datagrid` — a powerful, customizable data grid component with rich features. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## ✨ Features |
| 13 | + |
| 14 | +- 🚀 **High performance** rendering for large datasets |
| 15 | +- 🖊 **Inline Editing** (Add, Edit, Delete rows) |
| 16 | +- 🔍 **Sorting & Filtering** |
| 17 | +- 📄 **Pagination** support |
| 18 | +- 📦 **Drag-and-Drop** with nested levels |
| 19 | +- 🎨 Built with **Bootstrap** and fully customizable via Angular templates |
| 20 | +- ♿ **Accessible** (ARIA roles and keyboard navigation support) |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## 📦 Installation |
| 25 | + |
| 26 | + |
| 27 | +# Install the ngbootstrap datagrid package |
| 28 | +npm install @ngbootstrap/datagrid --save |
| 29 | + |
| 30 | +## 🛠 Usage |
| 31 | + |
| 32 | +**Import the module** into your Angular application: |
| 33 | + |
| 34 | +```ts |
| 35 | +import { NgModule } from '@angular/core'; |
| 36 | +import { BrowserModule } from '@angular/platform-browser'; |
| 37 | +import { NgbDatagridModule } from '@ngbootstrap/datagrid'; |
| 38 | +import { AppComponent } from './app.component'; |
| 39 | + |
| 40 | +@NgModule({ |
| 41 | + declarations: [AppComponent], |
| 42 | + imports: [ |
| 43 | + BrowserModule, |
| 44 | + NgbDatagridModule |
| 45 | + ], |
| 46 | + bootstrap: [AppComponent] |
| 47 | +}) |
| 48 | +export class AppModule {} |
| 49 | + |
| 50 | +``` |
| 51 | +## 2. Use the component in your template |
| 52 | + |
| 53 | +```html |
| 54 | +<ngb-datagrid |
| 55 | + [data]="rows" |
| 56 | + [columns]="columns" |
| 57 | + (rowAdded)="onRowAdded($event)" |
| 58 | + (rowUpdated)="onRowUpdated($event)" |
| 59 | + (rowDeleted)="onRowDeleted($event)"> |
| 60 | +</ngb-datagrid> |
| 61 | +``` |
| 62 | + |
| 63 | +### 3. Define your data and column config in the component |
| 64 | + |
| 65 | +```ts |
| 66 | +columns = [ |
| 67 | + { field: 'id', title: 'ID', sortable: true }, |
| 68 | + { field: 'name', title: 'Name', editable: true }, |
| 69 | + { field: 'email', title: 'Email', editable: true } |
| 70 | +]; |
| 71 | + |
| 72 | +rows = [ |
| 73 | + { id: 1, name: 'John Doe', email: 'john@example.com' }, |
| 74 | + { id: 2, name: 'Jane Smith', email: 'jane@example.com' } |
| 75 | +]; |
| 76 | + |
| 77 | +onRowAdded(newRow: any) { |
| 78 | + console.log('Row added:', newRow); |
| 79 | +} |
| 80 | +``` |
| 81 | +## 📚 Documentation |
| 82 | +Full documentation, demos, and API reference will be available soon at |
| 83 | +ngbootstrap.com |
| 84 | + |
| 85 | +## 🤝 Contributing |
| 86 | +We welcome contributions! Please follow these steps: |
| 87 | + |
| 88 | +1. Fork the repo |
| 89 | +2. Create a feature branch |
| 90 | +3. Commit your changes |
| 91 | +4. Open a pull request |
| 92 | + |
| 93 | +Before submitting PRs, run: |
| 94 | + |
| 95 | +```html |
| 96 | +npm run lint |
| 97 | +npm run test |
| 98 | +``` |
| 99 | + |
| 100 | +## 📜 License |
| 101 | +This project is licensed under the MIT License. |
| 102 | +See the LICENSE file for details. |
| 103 | + |
| 104 | +## 📬 Support |
| 105 | +If you find a bug or have a feature request, please open an issue at: |
| 106 | +https://github.com/you-know-nothing-h/ngbootstrap/issues |
4 | 107 |
|
5 | | -## Running unit tests |
6 | 108 |
|
7 | | -Run `nx test datagrid` to execute the unit tests. |
|
0 commit comments