Closed reach2rv closed 4 years ago
use filteringCriteria just like filtering a grid
this.form.Books.options.filteringCriteria = Serenity.Criteria.or([[bookfld.TariffCategory], '=', TariffCategory.Industrial],
[[bookfld.TariffCategory], '=', TariffCategory.Irrigation]);
see https://github.com/dfaruque/Serenity.Extra/tree/master/SerExtra/SerExtra.Web/Modules/BasicSamples/Grids/GridFilteredByCriteria for more filtering samples
this.form.Books.options.filteringCriteria = Serenity.Criteria.or([[bookfld.TariffCategory], '=', TariffCategory.Industrial], [[bookfld.TariffCategory], '=', TariffCategory.Irrigation]);
thanks.. but can you please elaborate, as in where to write filtering criteria on editor or on grid or on dialog. I tried with on grid but noting happens even debug does not hit.
Regards,
Arvind
Suppose you have a dialog called "DialogA". DialogA has a property with GridPickerEditor. then you could write the following in DialogA's constructor
this.form.Books.options.filteringCriteria = Serenity.Criteria.or([[bookfld.TariffCategory], '=', TariffCategory.Industrial],
[[bookfld.TariffCategory], '=', TariffCategory.Irrigation]);
here Books
will be your picker editor's property name. bookfld
will be picker row's fld should be declared on top of the ts file just bellow namespace line.
Hope you understand.
Thank You @dfaruque
Hi,
Thank you for this great work.
I am using your griditempicker and have scenario where need to load filtered data based on multiple criteria. as of now I can only set one
filterField: "AtbId", filterValue: this.ItemAtbId
how we can set multiple filters or array of values to filter. this will be good to have feature as in application we may required filter grid with multiple criteria.
Please advice.
Regards
Arvind