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

Filter for IsEmpty on the client

6 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dasha
Top achievements
Rank 1
Dasha asked on 28 Jul 2011, 07:17 PM
Hello, can you please provide the syntax for using non-parameter filter types, such as IsEmpty and NotIsNull from javascript?

6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 Aug 2011, 10:45 AM
Hi Dasha,

Note that filtering the RadGrid items is server operation and postback in this case is required. So you could not set custom filter items and handle their functionality only on the client. Find the help topics below which elaborates on customizing the filter options:
http://www.telerik.com/help/aspnet-ajax/grid-custom-option-for-filtering.html
http://www.telerik.com/help/aspnet-ajax/grid-custom-filter-options-with-handling.html


Best wishes,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Dasha
Top achievements
Rank 1
answered on 04 Aug 2011, 12:23 PM
Maria,

I'm able to call FIlter of type EqualTo from the client like this:
masterTable.filter(columnName, cellValue, Telerik.Web.UI.GridFilterFunction.EqualTo);
This triggers a call back, and the Grid presents me with correct results.  Are you saying that IsNull is considered a custom filter and that I cannot make a similar call from the client?
0
Maria Ilieva
Telerik team
answered on 09 Aug 2011, 02:24 PM
Hello Dasha,

The syntax for the IsNull filter is the same as you already applied for the EqualTo filter. See the help topic below for more information on this matter:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-get-filterexpressions.html

All the best,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Dasha
Top achievements
Rank 1
answered on 10 Aug 2011, 02:13 PM
So far I've tried the following variations:
var columnName = 'Status';
masterTable.filter(columnName, '', Telerik.Web.UI.GridFilterFunction.IsNull);
masterTable.filter(columnName, null, Telerik.Web.UI.GridFilterFunction.IsNull);
masterTable.filter(columnName, Telerik.Web.UI.GridFilterFunction.IsNull);

I'm getting an error on all.  Can you please tell me what I am doing wrong?
0
Maria Ilieva
Telerik team
answered on 15 Aug 2011, 10:30 AM
Hi Dasha,

Try canceling the postback. For example:
function OnClientClicking(sender, args)
  {
      var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
      args.set_cancel(true);//canceling postback
      masterTable.filter("columnName", "", Telerik.Web.UI.GridFilterFunction.IsNull, true);
    
  }

Give this a try and let me know if it works.


Greetings,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Maria Ilieva
Telerik team
answered on 15 Aug 2011, 10:30 AM
Hi Dasha,

Try canceling the postback. For example:
function OnClientClicking(sender, args)
  {
      var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
      args.set_cancel(true);//canceling postback
      masterTable.filter("columnName", "", Telerik.Web.UI.GridFilterFunction.IsNull, true);
    
  }

Give this a try and let me know if it works.


Greetings,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Dasha
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Dasha
Top achievements
Rank 1
Share this question
or