J'utilise Telerik MVC Grid et j'ai besoin d'appliquer les règles de filtrage ci-dessous, mais cela ne semble s'appliquer qu'aux deux premières colonnes et ignorer toutes les autres colonnes.Appliquer des règles dans Telerik MVC Grid Filter
ici Code JS: (en supposant la grille est $ ("grid #") de données (le "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);
}
Résultat de console.log (critère de recherche): substringof (Doc_No, » Opriyandi ') ou ~ substringof (Type,' Opriyandi ') ~ ou ~ substringof (Request_By,' Opriyandi ') ~ ou ~ substringof (Request_Date,' Opriyandi ') ~ ou ~ substringof (Département,' Opriyandi ') ~ ou ~ substringof (Plant, 'Opriyandi') ~ ou ~ substringof (Description, 'Opriyandi') ~ ou substringof (IT_Support, 'Opriyandi') ~ ou ~ substringof (Statut, 'Opriyandi')
Regardez avant et après appliquer les filtres en pièce jointe.
Est-ce une sorte de bug ou peut-être que j'ai fait quelque chose de mal .. Merci. * Utiliser Telerik MVC 2011.3.1229
* Veuillez me demander si vous avez besoin d'informations supplémentaires concernant mon problème. :)
Pièce jointe:
- BeforeApplyingFilter.png
- AfterApplyingFilter