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

Grid custom filter form bug?

0 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tirso
Top achievements
Rank 1
Tirso asked on 17 Feb 2012, 02:19 PM
Hi, (and sorry for my bad english)

I
encountered an error when filtering when the property extra = false. In this case does not filter properly.

an example:
$("#grid").kendoGrid({
dataSource : dataSource,
selectable : "row",
pageable : true,
sortable : {
mode : "multiple",
allowUnsort : true
},
height : 600,
rowTemplate : kendo.template($("#rowTemplate").html()),
altRowTemplate : kendo.template($("#rowTemplateAlt").html()),
filterable : true,
columns : [{
width : "100px",
title : "Foto",
field : "foto",
filterable : false
}, {
title : "Nombre",
field : "nombre",
filterable: {
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contiene"
}
}
}
}, {
title : "Apellidos",
field : "apellidos",
filterable: {
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contiene"
}
}
}
}, {
title : "Edad",
field : "edad",
filterable : true,
filterable: {
extra: true, //show extra filters
operators: { // redefine the string operators
number: {
lt: "menor de",
gt: "mayor de"
}
}
}
}, {
title : "Idioma",
field : "idioma",
filterable : true,
filterable: {
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contiene"
}
}
}
}, {
title : "Categorias",
field : "categorias",
filterable : true,
filterable: {
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contiene"
}
}
}
}, {
title : "Telefono",
field : "telmovil",
filterable : true,
filterable: {
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contiene"
}
}
}
}, {
title : "Acciones",
filterable : false
}]
})

debugging, I realized that in kendo.data.js, the property expressions.filters[1].value id undefined.
and I have solved the problem by adding these lines of code in filter function, just after  if (!expressions || expressions.filters.length === 0) {return this;  }
if ( expressions.filters.length == 2){
                if ( expressions.filters[1].value == "undefined" ){
                    expressions.filters.pop();
                }
            }









No answers yet. Maybe you can help?

Tags
Grid
Asked by
Tirso
Top achievements
Rank 1
Share this question
or