Coder Social home page Coder Social logo

gridjs-angular's People

Contributors

joeskeen avatar salamaashoush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

paulcrp joeskeen

gridjs-angular's Issues

Column resizable doesn't work

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 :

image

thanks for your help.

;)

Error when loading the grid in the page

I am getting the following error when having pagination and sort enabled: "An error happened while fetching the data"

image

If I disable sort
image

or I disable pagination
image

  • none of the following events is being triggered: gridLoad, beforeLoad, ready

Type definition error with Typescript

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:

  • Angular: 12.0.1
  • TypeScript: 4.2.3
  • GridJS: 5.0.2
  • gridjs-angular: 1.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.