Open janisvisma opened 3 months ago
Hi, @janisvisma Thank you for your Issue!
I Add in new version v 1.0.33 new properties rowCustomFilter in OdataServerSideProvider.
Usage example
new OdataProvider({
callApi: (options) =>
fetch(
`https://odatasampletest.azurewebsites.net/odata/Heroes${options}`,
{
headers: {
"Content-type": "application/json",
Accept: "application/json",
},
}
).then((resp) => resp.json()),
beforeRequest: (query, provider) => {},
afterLoadData: (options, rowData, totalCount) => {
if (options.skip === 0 && rowData.length > 0) {
params.columnApi.autoSizeAllColumns();
}
},
rowCustomFilter: {
AddedOn: (colName,value ) => {
return `${colName} eq ${value}`};
}
}
})
You can check it in this sandbox
Please, check it, and give me feedback.
Hi @SenyaMur, Thanks for quick response!
I have tested your provided example and it works on our environment too. However, now the same problem occurs in pivot
mode.
Steps to repo:
AddedOn
Id
Steps to Reproduce:
Create a dataset with date fields. Configure Ag-Grid to display the dataset, allowing grouping by date fields. Attempt to group the data by date. Group works as expected. Expand grouped row. Odata uses date to filter value as string (not a date type)
Expected Behavior: Odata filter uses date as intended. https://odatasampletest.azurewebsites.net/odata/Heroes?$count=true&$top=100&$filter=AddedOn eq 2024-03-28 Actual Behavior: When expand a grouped column (by date), Odata sends a request as grouped Date is a type of string. this triggers a backend error. https://odatasampletest.azurewebsites.net/odata/Heroes?$count=true&$top=100&$filter=AddedOn eq '2024-03-28'
I have attached a repo. for the following issue. Steps:
AddedOn
column