Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
199 stars 35 forks source link

Apply a specific filter on a column from an external input #94

Closed Methraen closed 4 years ago

Methraen commented 4 years ago

@Mewriick Like, imagine i want to search "a" in my column "Names" for example but i want the user to type it in an input above the table, is this possible to bind this input or something in order to make it filter on a certain column. (and the same thing on a button to reset the filter)...

Mewriick commented 4 years ago

@Methraen

There is no support to connect external field to the internal functionallity of filtering.

Only you can do with LazyLoaded Grid that you can have separated input and in LazyLoadingOptions you can specify request params which can contain the value from your input and after that you can chahge LazyLoadingOptions for your Grid and request is send to the server.

Maybe I will consider how to connect external inputs for filterting with embedded filtering feature.

Methraen commented 4 years ago

@Mewriick One more question, how can i reload the set of datas in the table ?

I try this, but it's not working :

Forecast = await applicationService.GetJsonCustomAsync<EmployeeInfoDto>($"api/v1/MWEquality/GetModel?periodId={applicationService.period}");
EmployeesNew = DtoConverter.ConvertEmployeeOldInfoDto2TableDto(Forecast);
dataAdapter = new CollectionTableDataAdapter<TableDto>(EmployeesNew);

the table looks like that :

<GridView DataAdapter="@dataAdapter" PageSize="250" SaveOperationFinished="@(async(p) => await ItemSavedOperationFinished(p))"></GridView>

Mewriick commented 4 years ago

@Methraen

https://github.com/Mewriick/Blazor.FlexGrid/wiki/Triggers#change-dataadapter