This is a migrated thread and some comments may be shown as answers.

[Solved] Cannot Apply Many Filters on Grid

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Enriko
Top achievements
Rank 1
Enriko asked on 27 Jan 2012, 10:09 AM
Hi Telerik,

I need to apply filter rules below, but it seems only apply to the first two column, and ignore all the rest of the columns.

Here JS Code : ( assume grid is $("#grid").data("tgrid") )

function extTelerikGridFilter(grid, value) {
    if (!$.isArray(grid.columns)) throw "Error : First Parameter accept only array.";
 
    var colLength = grid.columns.length - 1;
    var filterText = "";
 
    var tempArr = new Array();
    for (var i = 0; i < grid.columns.length; i++) {
        filterText = filterText + "substringof({0},'{1}')".replace("{0}", grid.columns[i].member).replace("{1}", value);
        if (colLength > 0) {
            filterText = filterText + "~or~";
            colLength = colLength - 1;
        }
    }
    console.log(filterText);
    grid.filter(filterText);
}

Result of console.log(filterText) :
substringof(Doc_No,'Opriyandi')~or~substringof(Type,'Opriyandi')~or~substringof(Request_By,'Opriyandi')~or~substringof(Request_Date,'Opriyandi')~or~substringof(Department,'Opriyandi')~or~substringof(Plant,'Opriyandi')~or~substringof(Description,'Opriyandi')~or~substringof(IT_Support,'Opriyandi')~or~substringof(Status,'Opriyandi')

Look before and after applying the filters in attachment.

Is this some kind of bug or perhaps i did something wrong.. Thank You.

*Using Telerik MVC 2011.3.1229
*Please ask me if you need another information regarding my issue. :)

2 Answers, 1 is accepted

Sort by
0
Enriko
Top achievements
Rank 1
answered on 30 Jan 2012, 02:24 AM
anybody have solution for this issue ? Appreciate It..
0
Vladimir
Top achievements
Rank 1
answered on 26 Feb 2012, 06:19 PM
Tags
Grid
Asked by
Enriko
Top achievements
Rank 1
Answers by
Enriko
Top achievements
Rank 1
Vladimir
Top achievements
Rank 1
Share this question
or