GithubHelp home page GithubHelp logo

vitocmpl / ng2-ya-table Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 7.0 9.98 MB

Angular yet another table

Home Page: https://vitocmpl.github.io/ng2-ya-table/

License: MIT License

TypeScript 87.63% JavaScript 2.74% HTML 7.60% CSS 0.09% Shell 0.09% SCSS 1.84%
table angular2 angular-2 ng2 sort pagination filter bootstrap3 bootstrap server-side

ng2-ya-table's People

Contributors

dependabot[bot] avatar hepifish avatar juanpablolopez avatar vitocmpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ng2-ya-table's Issues

click event issue

render: (data: any, row: any): string => {
return "

" +
"<span class='glyphicon glyphicon-pencil' (click)='editDocumentTypeId(row)'>" +
"
";
},

I have added a button i.e. editDocumentTypeId(row) in span tag. but it is not working. How it works in this datatable

Need example with array as datasource

Could someone add an example/demo with a simple array as the data source? This question was posted on StackOverflow months ago and is unanswered. This would make ng2-ya-table usable for a wider audience.

No styling out of the box

Hi I'm testing out your data table for my own project,
but is it correct there is no default styling to the table?
I was kinda hoping that it would look the samen as the demo out-of-the-box.

This is what it looks like when I implement the simple demo.

capture

Error when getting data dynamically from another component using @Input

I am getting following error when I am getting data dynamically from another component:

ERROR TypeError: Cannot read property 'isFirstChange' of undefined
at Ng2YaTableComponent.ngOnChanges (index.js:256)

I have made separate component for table and using this component in other components. Below is the code of my table component.

Below is my code:
`

@Input() data: any[] = [];
@Input() columns: any[] = [];

constructor() {
 
}

public options:any = {
    orderMulti: false,
    className: ['table-striped'],
    language: "en"
}

public paging: any = {
    itemsPerPage: 10,
    itemsPerPageOptions: [10, 25, 50, 100],
    maxSize: 5
}

`

<ng2-ya-table [options]="options" [columns]="columns" [datasource]="data" [paging]="paging"> </ng2-ya-table>
I am getting data and columns from another component and they are successfully reaching to this component. What am I missing here?

Column with dropdown menu

Hi how could i add a column containing a dropdown menu. The dropdown menu items would need to navigate to other pages using routerLink and would also need to call functions on the component.

Thanks

language

How to change the language in the elements?

ngx-bootstrap missing

Hi,
When you install the package the ngx-bootstrap package is missing.
Maybe you can add it to the package.json so it gets installed automatically.

Button Double click

I had two buttons defined in columns as below

    { 
        title: 'Action', 
        name: 'Action', 
        sort: false, 
        defaultSortOrder: 'asc',
        render: (data: any, row: user): string => {
            return "<input type='button' style='text-transform: uppercase; color: #fff;line-height: 1.2;background: linear-gradient(to right, #a182e8, #9c8deb,#9899ed,#92a4f1,#90a9f2,#8db0f4,#8cb4f5);font-family: lato-regular;font-size: 15px;padding: 10px;text-align: center;text-transform: uppercase;border: none;border-radius: 12px;' class='accept' value='Accept'>";   
        },
        action: (data: any, row: user): any => {                
            this.Accept(row.uid);
        }  
    },
    { 
        title: '', 
        name: 'Action', 
        sort: false, 
        defaultSortOrder: 'asc',
        render: (data: any, row: user): string => {
            return "<input type='button' style='text-transform: uppercase; color: #fff;line-height: 1.2;background: linear-gradient(to right, #a182e8, #9c8deb,#9899ed,#92a4f1,#90a9f2,#8db0f4,#8cb4f5);font-family: lato-regular;font-size: 15px;padding: 10px;text-align: center;text-transform: uppercase;border: none;border-radius: 12px;' class='reject' value='Reject'>";
        },            
        action: (data: any, row: user): any => {                
            this.Reject(row.uid);
        }  
    }

The single click is not working on buttons. On double click, it works fine. Did not understand why this is happening.
Please look into it.

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.