Mixing serverFilter und textFilter

Hello,
I have a datatable which contains serverFilters and one textFilter column.
I want to filter the textFilter column locally. But everytime I change the value, the request is sent to the server.
How can I filter on the client side?

let datatable = {        
    view: "datatable",
    id: oConfig.sDataTableId,
    hover: "datatable_hover",
    complexData: true,
    dragColumn: true,
    editable: false,
    resizeColumn: true,
    select: "row",
    scroll: "xy",
    pager: oConfig.sPagerId,
    url: "intra->member",
    columns: [
    {
        id: "email",
        header: ["E-Mail", {content: "serverFilter"} ],
        width: 250,
    }, {            
        id: "department_name",
        template: function(item) {                
            let arrDepts = [];
            for(dept in item.departments) {
                arrDepts.push(item.departments[dept].displayTitle);
            }
            return arrDepts.join(", ");
        },            
        header: ["Gruppen", {content: "textFilter"} ],
        width: 400,
        fillspace: 1
    }]
}

Comments

  • edited May 8

    Hello,

    This is by design. We assume that if one of the filters is a server one, the others also start working in a server mode. Combining both may cause difficulties: if you for instance filter data on serverside, you cannot unfilter it locally.

    Maybe you need a separate input outside a datatable to filter locally or on server not to mix both types.

    If you still want to try combining them, you need to provide a local flag to the custom grid.filterByAll() function that is called when a value in any filter changes. If it is "local", so call the grid.filter() function to filter locally. Otherwise let the built-in logic run: https://snippet.webix.com/niev47xo

  • After using a custom filter-method it worked.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion