i am currently developing a custom icingaweb2 module.
For this module i used the build-in pagination, limit and sort controls, which worked fine.
I also need to use a filter though for easier navigation, so i looked into the filterEditor, using the setupFilterEditor() function.
I can’t seem to get this working right. The editor pops up in the view and the quick search works, but after using any functionality of the filter editor, just changing one value or clicking any + button brings up an error saying:
> Trying to get invalid filter index "1-3-1" from "host_name = *test* | starttime = *test* | endtime = *test* | output = *test*" ("1")
(Where the index 1-3-1 is always the same when using quick search, it doesnt matter which + or trashcan i click on)
I have tried everything i could imagine, but i just cant get this to work, is there maybe something that needs to be done beforehand? Some setup of sorts?
Or could something mess the filterEditor up?
I can provide screenshots and code samples if needed, i am glad for every possible solution or any help at all.
Best regards,
Michel W.
EDIT
So it seems like the very first filter column already has an invalid index, inspecting it through dev tools says: ‘name=operator_1-3’, while looking at the monitoring module, the first column says: ‘name=operator_1’, which would seem to be needed here.
What could cause this wrong index?
There is no such method in the framework. Do you actually mean setupFilterControl()? This should parse the filter from the request’s url and hence shouldn’t use invalid indexes. Are you maybe parsing/setting the filter object yourself?
Quick side note: when changing the parameters in the url directly, there is no error, no matter how often i change them.
If i paste a valid search query in there, it will work.
The error only occurs, when a change occurs after one value has been changed already before, when using the filter editor directly.