MCPcopy Index your code
hub / github.com/akveo/ng2-smart-table

github.com/akveo/ng2-smart-table @v1.7.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.7.2 ↗ · + Follow
489 symbols 927 edges 114 files 8 documented · 2% 2 cross-repo links updated 23mo agov1.7.2 · 2020-11-12★ 1,620863 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Status

Angular Smart Table Component

ng2-smart-table component made with :heart: by Akveo team. Follow us on Twitter to get latest news about this component first!

⚠ Low Maintenance

Due to project priority and resource constraints, this project is currently on low maintenance. We recognize that there are a lot of activities around this package. However, we are unable to accommodate the maintenance this project requires.

Demo

Live Demo

alt tag

Installation

The library is available as npm package, so all you need to do is to run the following command:

npm install --save ng2-smart-table

This command will create a record in your package.json file and install the package into the npm modules folder.

Minimal Setup Example

First thing you need to do is to import the ng2-smart-table directives into your component.


import { Ng2SmartTableModule } from 'ng2-smart-table';

Then register it by adding to the list of directives of your module:

// ...

@NgModule({
  imports: [
    // ...

    Ng2SmartTableModule,

    // ...
  ],
  declarations: [ ... ]
})
// ...

Now, we need to configure the table and add it into the template. The only required setting for the component to start working is a columns configuration. Let's register settings property inside of the component where we want to have the table and configure some columns Settings documentation:

settings = {
  columns: {
    id: {
      title: 'ID'
    },
    name: {
      title: 'Full Name'
    },
    username: {
      title: 'User Name'
    },
    email: {
      title: 'Email'
    }
  }
};

Finally let's put the ng2-smart-table component inside of the template:

// ...

@Component({
  template: `
    <ng2-smart-table [settings]="settings"></ng2-smart-table>
  `
})
// ...

At this step you will have a minimal configured table. All functions are available by default and you don't need to configure them anyhow, so now you can add/edit/delete rows, sort or filter the table, etc.

Still it seems like something is missing... Right, there is no data in the table by default. To add some, let's create an array property with a list of objects in the component. Please note that object keys are the same as in the columns configuration.

data = [
  {
    id: 1,
    name: "Leanne Graham",
    username: "Bret",
    email: "Sincere@april.biz"
  },
  {
    id: 2,
    name: "Ervin Howell",
    username: "Antonette",
    email: "Shanna@melissa.tv"
  },

  // ... list of items

  {
    id: 11,
    name: "Nicholas DuBuque",
    username: "Nicholas.Stanton",
    email: "Rey.Padberg@rosamond.biz"
  }
];

And pass the data to the table:

// ...

@Component({
  template: `
    <ng2-smart-table [settings]="settings" [source]="data"></ng2-smart-table>
  `
})
// ...

Now you have some data in the table.

Further Documentation

Installation, customization and other useful articles: https://akveo.github.io/ng2-smart-table/

How can I support developers?

  • Star our GitHub repo :star:
  • Create pull requests, submit bugs, suggest new features or documentation updates :wrench:
  • Follow us on Twitter :feet:
  • Like our page on Facebook :thumbsup:

Can I hire you guys?

Yes! Visit our homepage or simply leave us a note to contact@akveo.com. We will be happy to work with you!

Features

  • Local data source (Server/API DataSource is on its way)
  • Filtering
  • Sorting
  • Pagination
  • Inline Add/Edit/Delete
  • Flexible event model

License

MIT license.

Special thanks to our awesome contributors!

nnixaalexzhukovdamnkoTibingEzeonDeilanhosweystacyakveoAkshaymisal5geneeblackvvandoorneananthhhbis-sbtadashi-aikawa

nurehavlupu10zhouhao27hkb1990liaosongktriek

From akveo

Enjoy :metal: We're always happy to hear your feedback!

Extension points exported contracts — how you extend this code

ViewCell (Interface)
(no doc) [2 implementers]
projects/ng2-smart-table/src/lib/components/cell/cell-view-mode/view-cell.ts
Editor (Interface)
(no doc) [1 implementers]
projects/ng2-smart-table/src/lib/components/cell/cell-editors/default-editor.ts
Filter (Interface)
(no doc) [1 implementers]
projects/ng2-smart-table/src/lib/components/filter/filter-types/default-filter.ts

Core symbols most depended-on inside this repo

getSetting
called by 53
projects/ng2-smart-table/src/lib/lib/grid.ts
getColumn
called by 22
projects/ng2-smart-table/src/lib/lib/data-set/cell.ts
getData
called by 14
projects/ng2-smart-table/src/lib/lib/data-set/row.ts
next
called by 10
projects/ng2-smart-table/src/lib/components/pager/pager.component.ts
showActionColumn
called by 8
projects/ng2-smart-table/src/lib/lib/grid.ts
emitSelectRow
called by 6
projects/ng2-smart-table/src/lib/ng2-smart-table.component.ts
setPage
called by 6
projects/ng2-smart-table/src/lib/lib/data-source/local/local.data-source.ts
getPaging
called by 6
projects/ng2-smart-table/src/lib/lib/data-source/local/local.data-source.ts

Shape

Method 269
Class 189
Function 28
Interface 3

Languages

TypeScript100%

Modules by API surface

projects/ng2-smart-table/src/lib/lib/grid.ts36 symbols
projects/ng2-smart-table/src/lib/lib/data-source/local/local.data-source.ts28 symbols
projects/ng2-smart-table/src/lib/ng2-smart-table.component.ts26 symbols
projects/ng2-smart-table/src/lib/lib/data-source/data-source.ts22 symbols
projects/ng2-smart-table/src/lib/lib/data-set/data-set.ts22 symbols
projects/ng2-smart-table/src/lib/lib/data-set/column.ts14 symbols
projects/ng2-smart-table/src/lib/components/pager/pager.component.ts14 symbols
projects/ng2-smart-table/src/lib/lib/data-source/server/server.data-source.ts12 symbols
projects/ng2-smart-table/src/lib/lib/data-set/row.ts11 symbols
projects/ng2-smart-table/src/lib/lib/data-set/cell.ts11 symbols
projects/ng2-smart-table/src/lib/components/cell/cell-view-mode/custom-view.component.ts9 symbols
projects/demo/src/app/pages/examples/custom-edit-view/basic-example-button-view.component.ts9 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add ng2-smart-table \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page