mazdik / ng-mazdik

Angular UI component library
https://mazdik.github.io/ng-mazdik
MIT License
89 stars 34 forks source link

Default filter in CRUD table on first load #71

Closed hghew closed 4 years ago

hghew commented 4 years ago

Hi mazdik, is that possible to set certain column to be filtered when first load? for example, the crud table has 5 columns, 1 column with selection Active / Inactive, when first loading on the crud table, I would like to show Active (selected as filter value for that column)

Thanks.

mazdik commented 4 years ago

try


this.settings.initLoad = false;
this.dataManager = new DataManager(this.columns, this.settings, service);

this.dataManager.dataFilter.setFilter(value, 'race', FilterOperator.EQUALS);
this.dataManager.events.onFilter();
``
hghew commented 4 years ago

try

this.settings.initLoad = false;
this.dataManager = new DataManager(this.columns, this.settings, service);

this.dataManager.dataFilter.setFilter(value, 'race', FilterOperator.EQUALS);
this.dataManager.events.onFilter();
``

thanks, it works I tried without this.settings.initLoad = false;