我试图使用ng2-smart-table这个问题我不知道如何将加号按钮(addButtonContent)与一些创建函数数据绑定.现在这只是为我打开anther raw来插入数据.
还有怎么做编辑按钮.
我的代码是:
还有怎么做编辑按钮.
我的代码是:
settings = { add: { addButtonContent: '<i class="ion-ios-plus-outline"></i>',//how to call some function to this one createButtonContent: '<i class="ion-checkmark"></i>',cancelButtonContent: '<i class="ion-close"></i>',},edit: { editButtonContent: '<i class="ion-edit"></i>',saveButtonContent: '<i class="ion-checkmark"></i>',delete: { deleteButtonContent: '<i class="ion-trash-a"></i>',confirmDelete: true },
和我的模板:
<ba-card title="Basic Example" baCardClass="with-scroll"> <div class="form-group"> <input #search type="search" class="form-control form-control-lg" placeholder="Search..." (keyup)="onSearch(search.value)"> </div> <ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)"></ng2-smart-table> </ba-card>
在你的模板中添加这个
原文链接:https://www.f2er.com/angularjs/240456.html<ng2-smart-table class='form-control' [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)" (editConfirm)="onSaveConfirm($event)" (createConfirm)="onCreateConfirm($event)" ></ng2-smart-table>
然后在您的组件中调用新操作
onCreateConfirm(event):void { } onSaveConfirm(event):void { } onDeleteConfirm(event): void { }