Javascript Error on RadGrid Filter

Posted by Community Admin on 04-Aug-2018 22:22

Javascript Error on RadGrid Filter

All Replies

Posted by Community Admin on 23-Jan-2012 00:00

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>

Any help would be greatly appreciated.

Thanks,
Chris Aumiller

Posted by Community Admin on 24-Jan-2012 00:00

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;
,

For some reason, this.get_columns().length is returning 0, thus the get_columns()[b] call is never actually being called, and it defaults to a null return.

Any ideas, anyone?

ETA: I should add that we are using Sitefinity 4.3.

Thanks,
Chris Aumiller

Posted by Community Admin on 26-Jan-2012 00:00

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

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

Posted by Community Admin on 26-Jan-2012 00:00

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

Posted by Community Admin on 27-Jan-2012 00:00

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

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

Posted by Community Admin on 07-Feb-2012 00:00

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

Posted by Community Admin on 08-Feb-2012 00:00

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

Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

Posted by Community Admin on 08-Feb-2012 00:00

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

Posted by Community Admin on 13-Feb-2012 00:00

Hello

What might be causing a problem is as mentioned above other widgets on the page or scripts loaded with the master page template. To test if this is the case can you place the Grid widget on a new page using no template (start from scratch) and check if the same problem will appear. If not the problem is in te template.

Best wishes,
Stanislav Velikov 
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed