1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Javascript Error on RadGrid Filter

Javascript Error on RadGrid Filter

9 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    23 Jan 2012
    Link to this post
    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
  2. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    24 Jan 2012
    Link to this post
    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
  3. Veli
    Veli avatar
    3 posts
    Registered:
    26 Jun 2017
    26 Jan 2012
    Link to this post
    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
  4. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    26 Jan 2012
    Link to this post
    Veli,

    I am not getting errors on load; only when I attempt to click the filter button.

    That error is:

    f is null
    http://localhost:8080/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radScriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen%3a89093640-ae6b-44c3-b8ea-010c934f8924%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.915.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen%3a9799c67b-558a-475d-bf30-a0ccf0dbb8b7%3a16e4e7cd%3af7645509%3aed16cbdc%3a24ee1bba%3a7165f74%3a58366029%3ae330518b%3a1e771326%3ac8618e41%3ae4f8f289
    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
  5. Veli
    Veli avatar
    3 posts
    Registered:
    26 Jun 2017
    27 Jan 2012
    Link to this post
    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
  6. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    07 Feb 2012
    Link to this post
    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
  7. Veli
    Veli avatar
    3 posts
    Registered:
    26 Jun 2017
    08 Feb 2012
    Link to this post
    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 >>
  8. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    08 Feb 2012
    Link to this post
    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
  9. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    21 Jul 2017
    13 Feb 2012
    Link to this post
    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
9 posts, 0 answered