Closed shaimaaezo closed 1 year ago
this was happening to me too, but you need to declare and set your settings as a global variable:
@Component({
selector: "yourComponent",
templateUrl: "./yourComponent.component.html",
styleUrls: ["./yourComponent.component.scss"],
})
export class yourNameComponent{
globalVariable1: any;
globalVariable2: any;
globalVariableN: any;
// declare your seettings here as global
settings = {
columns: {...},
mode: 'internal',
actions:{...}
....
};
constructor(){ ... }
}
this was happening to me too, but you need to declare and set your settings as a global variable:
@Component({ selector: "yourComponent", templateUrl: "./yourComponent.component.html", styleUrls: ["./yourComponent.component.scss"], }) export class yourNameComponent{ globalVariable1: any; globalVariable2: any; globalVariableN: any; // declare your seettings here as global settings = { columns: {...}, mode: 'internal', actions:{...} .... }; constructor(){ ... } }
thank you very much, its work
Hi, this issue appears when I come to refresh page component, this is my code => this.settings = { mode: 'internal', actions: { title: data['Action'], add: false, delete: false, }, edit: { editButtonContent: '', }, columns: { code: { title: data['creditLimitCode'], type: 'string', }, name: { title: data['creditLimitName'], type: 'string', }, days: { title: data['creditLimitDays'], type: 'string', }, discount: { title: data['creditLimitDiscount'], type: 'string', }, } }
<ng2-smart-table class="creditlimit-smart-table" [settings]="settings" [source]="source" (edit)="onEdit($event)">
::ng-deep .creditlimit-smart-table { .form-control { color: nb-theme(form-control-color); } }