grid-js / gridjs-angular Goto Github PK
View Code? Open in Web Editor NEWAngular wrapper for Grid.js
Angular wrapper for Grid.js
Hi,
I create a from scratch project with angular, and i would like to have resizable column , i read the documentation and i see that resizable=true should work as expected but it doesn't work. May i miss something?
My template:
<gridjs-angular
[data]="data"
[columns]="columns"
[sort]="true"
[search]="true"
[pagination]="true"
[resizable]="true"
(gridLoad)="onLoad($event)"
(beforeLoad)="onBeforeLoad($event)"
(ready)="onReady($event)"
(cellClick)="onCellClick($event)"
(rowClick)="onRowClick($event)"
></gridjs-angular>
My ts:
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { GridJsAngularComponent } from 'gridjs-angular';
import { faker } from '@faker-js/faker/locale/en';
import { TData } from 'gridjs/dist/src/types';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, GridJsAngularComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
title = 'test_gridjs';
columns = ['Name', 'Email', 'Phone Number'];
data: TData = Array.from({ length: 100 }).map(() => [
faker.person.fullName(),
faker.internet.email(),
faker.phone.number(),
]);
onLoad = (event: any) => console.log('Grid loaded', event);
onBeforeLoad = (event: any) => console.log('Before grid loaded', event);
onReady = (event: any) => console.log('Grid ready', event);
onCellClick = (event: any) => console.log('Grid cell clicked', event);
onRowClick = (event: any) => console.log('Grid row clicked', event);
}
And the result :
thanks for your help.
;)
gridjs-angular currently only supports gridjs v4. Is this going to be updated to v6 anytime soon?
I am trying to use the plugin with latest version of angular with Typescript and getting following issue. I have gone through the documentation and everything, but not able to figure out any solution. It seems, there is some issue with type declaration in the probably core plugin.
Error: node_modules/gridjs/dist/src/view/base.d.ts:5:67 - error TS2344: Type 'unknown' does not satisfy the constraint 'BaseProps'.
5 export declare abstract class BaseComponent<P extends BaseProps = unknown, S = unknown> extends Component<P, S> {
Feel free to close this, if it's not an real issue.
Environments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.