Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angularjs How to add row after the last row in ng2 smart table

<ng2-smart-table
  [settings]="settings"
  [source]="data"
  (createConfirm)="create($event)"
></ng2-smart-table>

  create(event: { newData: Object; source: DataSource; confirm: Deferred }) {
    event.source.append(event.newData);
    event.confirm.reject();
}


import { DataSource } from 'ng2-smart-table/lib/lib/data-source/data-source';
import { Deferred } from 'ng2-smart-table/lib/lib/helpers';


  create(event: { newData: Object; source: DataSource; confirm: Deferred }) {
    event.source.append(event.newData);
    event.confirm.resolve.skipAdd = true;
    event.confirm.resolve();
  }
 
PREVIOUS NEXT
Tagged: #angularjs #How #add #row #row #smart #table
ADD COMMENT
Topic
Name
3+6 =