-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sortField is overriding filterField value and breaking filtering #48
Comments
Hi Ornamentum Team, This is a wonderful plugin, with lot of features pre installed. I am also having the same issue, as mentioned by @devakone . I have a date field which is being sorted with the help of sortField attribute with another calculated unix time epoch value of the date. Sorting was successful, but filter was not working properly. If i remove the sortField attribute, the filter works fine. Then I checked the document for filters and then found out this attribute "filterField". I tried giving the field exactly as the "field" attribute to override "sortField" value and it's functionality. But not working as expected and "filterField" value is not being considered. Any solution would be appreciated for this issue. .. for the "filterField" attribute to work. |
Hi @arunmeanssun . This is how i solved it for my own case which was a string, not a date, so keep that in mind. component.html
then in component.ts
So basically you have to
This is what you have to do if you want to mix |
Thank you @devakone , It's working for me even with the date field. We have date as a string and then time as also string. we internaly process to generate unix time for sorting purpose. Now the filter is also working along with sort feature with filter expression handler, mentioning the column name ("date") in the if condition like below. riskLevelFilterHandler(item: any, field: string, filterValue: any) { Thanks a lot, @devakone for the filterHandler function... |
Hello thanks for this nice library! Very powerful and flexible.
I am using 8.1.4 and ran into a weird issue mixing
sortField
andfilterField
.Here is my data shape
Here my column definition for the Risk Level column, which should use
riskLevel
for display butriskLevelValue
for sorting since the numeric value is what matters for the sorting.As you can see both
field
andfilterField
are set to theriskLevel
property, which is right, andsortField
is set to theriskLevelValue
.With things set up this way, sorting works absolutely, but filtering is broken. I did some debugging, that's why you see the
filterExpression
being set and found out that, as soon as[sortField]="'riskLevelValue'"
is set, thefield
sent at the second parameter to thefilterExpression
is always set toriskLevelValue
, even though the other field values are set. Is this a case of working as designed or is there an actual bug there?Thank you
The text was updated successfully, but these errors were encountered: