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

RadGrid FilterMenu causing javascript error, not sure if it is a bug

1 Answer 99 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Peter asked on 08 Sep 2014, 03:25 PM
When in Grid Init event:

With filtering active on a column, clicking the filter button generates this javascript error:

Uncaught TypeError: Cannot read property `_linkElement` of undefined

Referring to this code:
var h=this._filterMenu.get_focusedItem()||this._filterMenu.get_items().getItem(0);
if(h._linkElement){h._linkElement.focus();  <-- err line. 6623

The line above does not appear in the the version 2014.1.403.45 nor does the same error happen.

I have to add 
<ClientEvents OnFilterMenuShowing="RadGrid_DisableFilterMenu" />

function RadGrid_DisableFilterMenu(sender, args) {

1 Answer, 1 is accepted

Sort by
Konstantin Dikov
Telerik team
answered on 11 Sep 2014, 10:44 AM
Hello Peter,

The behavior that you are describing is due to the fact that the FilterMenu must have at least one element. As you can see in the line above the one throwing the error, when the menu is opened, the first item is retrieved with "filterMenu.get_items().getItem(0)". Since further logic depends on that item, when you remove all items from the FilterMenu, that logic will fail. 

Generally, there are no use cases when you will need a filter menu and have no items, so that is the reason for not checking the length of the items collection.

Hope this helps.

Best Regards,
Konstantin Dikov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question