0.0.3 • Published 6 years ago

motable v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Motable

A Angular dragable-reorder Table plugin with ngx-datatable & ngx-datatable

Usage

1.install

yarn add motable

2.import module

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    MotableModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

3.Use it

component:

  public rows: Array<any> = [];
  public columns: Array<any> = [];
  public placeholder: string;

  ngOnInit(): void {
    this.placeholder = '搜索...';
    this.columns = [
      {name: '用途', prop: 'usage'},
      {name: '用途2', prop: 'usage2'}
    ];

    this.rows = [
      {
        'usage': '客户付款 1',
        'usage2': '客户付款 1 用途2'
      }, {
        'usage': '客户付款 2',
        'usage2': '客户付款 2 用途2'
      }
    ];
  }

template:

<motable
  [id]="'maintain'"
  [rows]="rows"
  [placeholder]='placeholder'
  [columns]="columns"></motable>

License

Phodal's Idea

© 2018 A Phodal Huang's Idea. This code is distributed under the MIT license. See LICENSE in this directory.