Javascript Error on RadGrid Filter
I am using a RadGrid with filters, but when I click the filter button, I get an 'f is null' Javascript error and the filter options do not drop down.
In addition, I am unable to drag the columns to the "Drag a column header and drop it here to group by that column" at the top of the Grid. I suspect the two issues are related since it is a Javascript error being thrown.
I have been trying to use the demo version to possibly find the issue, but so far I've had no luck.
The code of the grid follows:
<
telerik:RadGrid
ID
=
"AwaitingEditingGrid"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
AllowMultiRowSelection
=
"True"
OnNeedDataSource
=
"Need_EditingGridDataSource"
AllowSorting
=
"True"
PageSize
=
"50"
AllowPaging
=
"True"
ShowGroupPanel
=
"True"
>
<
PagerStyle
Mode
=
"NumericPages"
AlwaysVisible
=
"true"
/>
<
MasterTableView
AutoGenerateColumns
=
"false"
AllowMultiColumnSorting
=
"true"
AllowFilteringByColumn
=
"true"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"ClientSelectColumn"
ItemStyle-Width
=
"50"
>
<
ItemStyle
Width
=
"50px"
></
ItemStyle
>
</
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Course column"
HeaderText
=
"Course"
DataField
=
"Course"
UniqueName
=
"Course"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter lesson column"
HeaderText
=
"Lesson"
DataField
=
"Lesson"
UniqueName
=
"Lesson"
>
</
telerik:GridBoundColumn
>
<
telerik:GridHyperLinkColumn
DataNavigateUrlFields
=
"URL"
DataNavigateUrlFormatString
=
"/0/Action/Edit"
DataTextField
=
"PageTitle"
FilterControlAltText
=
"Filter pagetitle column"
HeaderText
=
"Page Title"
SortExpression
=
"PageTitle"
UniqueName
=
"PageTitle"
>
</
telerik:GridHyperLinkColumn
>
<
telerik:GridBoundColumn
DataField
=
"ItemId"
FilterControlAltText
=
"Filter ItemIdColumn column"
UniqueName
=
"ItemIdColumn"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"Course"
SortOrder
=
"Ascending"
/>
<
telerik:GridSortExpression
FieldName
=
"Lesson"
SortOrder
=
"Ascending"
/>
</
SortExpressions
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
AllowDragToGroup
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
EnableDragToSelectRows
=
"true"
/>
</
ClientSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
More investigation reveals the following:
This Javascript seems to not be working correctly:
getColumnByUniqueName:
function
(a)
for
(
var
b = 0;
b <
this
.get_columns().length;
b++)
if
(
this
.get_columns()[b].get_element().UniqueName == a)
return
this
.get_columns()[b];
return
null
;
,
Hello Chris,
Are you getting any javascript errors initially when your page is loaded? Can you paste the error messages of these, if any? You can use the developer tools in your browser of choice to debug the javascript, e.g. Firebug in Firefox, Developer Tools in IE and Chrome, etc.
Veli
the Telerik team
Veli,
I am not getting errors on load; only when I attempt to click the filter button.
That error is:
f is null
localhost:8080/Telerik.Web.UI.WebResource.axd
Line 7713
I've actually been testing this with the recent 4.4 release, and we've also seen it in 4.3 as I mentioned earlier.
Thanks,
Chris
We are not able to identify the cause of this issue at this point. If you can open a regular support ticket and send us some test module or some other same code we can debug locally, we will be able to better identify the cause of the problem.
Veli
the Telerik team
In preparing to put together a solution for this, I put the widget I was using on a page by itself (intending to export the data I was using to an Excel sheet so I could send it to you folks). When the widget is on a page by itself, it works fine, but when it is a part of another page with other widgets, it doesn't work.
Have there been any reported issues with RadGrids and other widgets?
Thanks,
Chris
Hey Chris,
The error you are getting may be caused by various widgets on your page. Are you using any other third-party components at the same time in your pages? The Ajax Control Toolkit, for example, may have incompatibility with RadControls. If any, consider removing those to see if you are getting the same error.
Greetings,
Veli
the Telerik team
When removing it from a custom template, it seems to work just fine, so the problem seems to lie there. When you tested, did you test with a custom template, a Telerik template, or a blank one? That may be key to tracking this down.
ETA: The template in question has several custom user controls on it, as defined in the .master file. However, the only widget that's drop and draggable in the Sitefinity backend is the widget consisting of the RadGrid.
Thanks,
Chris