Hello.
I’d like to add some filters to my datatable (with server-side filters), but they should base on columns which are not shown and exist only inside my DB. How can I extend filters from datatable.getState().filter?
Hello.
I’d like to add some filters to my datatable (with server-side filters), but they should base on columns which are not shown and exist only inside my DB. How can I extend filters from datatable.getState().filter?
UPD:
this solution
http://docs.webix.com/desktop__server_proxy.html#creatingcustomproxyobjects
looks not good, because I should create my own url builder instead built-in one
Guys, actually I’m a Java coder and not too good in JS. I found next solution and I’d like you to check it:
var dt = $$('datatable');
var oldGetState = dt.getState;
voterTable.getState = function() {
var state = oldGetState.apply(dt, null);
state.filter['myAdditionalFilter'] = 'mad-mad JavaScript';
return state;
};
can it brake something in your framework?
And one more question: how to highlight block of code in question in my forum message?
Hello,
the code should be placed between js~~~ and ~~~ marks to be highlighted.
As to the question itself, you can redefine the getState
method, but there’s a better way to do this. You need to create a custom component based on datatable:
webix.protoUI({
name:"mydatatable",
getState:function{
var state = webix.ui.datatable.prototype.getState.call(this);
//your js code
return state;
}
});
webix.ui({
view:"mydatatable", //other config
});
Thank you, Helga.
This solution looks much better.