I am using PHP Data Connector to pull data from server into datatable. Dynamic loading of 10 records at a time, with sorting and filtering happening server side. All working fine.
But two issues:
If I use serverFilter in the columns def, that works fine. But when I try to use a custom filter() function on a certain field (like attached to a button click event), I get:
“Uncaught TypeError: Cannot read property ‘xyear’ of undefined”
The syntax I am using is
$$("dtable").filter("xyear", "1995");
What would cause that?
How would I programmatically add parameters to the data call before it gets sent to the Connector PHP file? When I use serverFilter in the columns def, I can see that Webix sends a url like:
I have figured out #2 through the datatable load method.
However #1 is giving me big problems. When I inspect the datatable object I can see that my 10 records are coming through fine, but then there is always an additional element that is undefined. i.e. the last index is always undefined which throws an error on any custom filter.
I have found the problem is with dynamic loading. If dynamic loading is turned off in the PHP file, OR if all records are loaded in at once, then custom filtering works fine. But if a subset of records are loaded via dynamic loading, then I get the Uncaught TypeError, referencing webix.js line 397
the thing is that Webix does not support client-side filtering on a dynamically load set. If you worked with webix_debug.js ( it’s included on a dev stage instead of webix.js), you would see the “Client side filtering can’t be used with dynamic loading” warning.
So, you can either use server filters or switch off dynamic loading.
If you are somehow limited by connector dynamic loading pattern, you can try a custom proxy to load dynamically.