This is a migrated thread and some comments may be shown as answers.
Adding custom non-gridcolumn filter clientside
3 Answers 28 Views
This is a migrated thread and some comments may be shown as answers.
staron
Top achievements
Rank 1
staron asked on 22 Jun 2009, 11:51 AM
Hi,
I'm trying to add a custom filter to grid using js, like this:
tableView.get_filterExpressions().clear();
tableView.get_filterExpressions().add("ContributionID='" + $get('cContributionID').value + "'");

And this works great. However; if we then filter using the gridcolumn it breaks on:
Telerik.Web.UI.GridFilterExpressions.prototype={find:function(_3e8){
for(var i=0,_3ea=this.get_count();i<_3ea;i++){
var item=this.getItem(i);
if(item.get_columnUniqueName()==_3e8){
return item;
}

Because item is just the filterstring.
I've read http://www.telerik.com/help/aspnet-ajax/grid_filter.html , but that requires that the filtered field is in the grid.

Please advice.

3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 25 Jun 2009, 11:06 AM
Hi staron,

The correct way to fire a filter command from the client is described in the article you have cited in your post. Could you elaborate on what you mean by "that requires that the filtered field is in the grid".

Thanks.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
staron
Top achievements
Rank 1
answered on 25 Jun 2009, 11:42 AM
Hi,
Say that we have a field called SearchColumn in the db table. This field is not a column in the grid. As I understood in the article it would then not be possible to add a filter on that field your way.
0
Tsvetoslav
Telerik team
answered on 30 Jun 2009, 05:15 PM
Hi staron,

That's correct, however, you can set the columns visibility property to false and still get the filtering behavior.

Best regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
staron
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
staron
Top achievements
Rank 1
Share this question
or