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

Error when showing window

2 Answers 93 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 13 Dec 2013, 07:42 PM
I get the following javascript error when I try to show a RadWindow

JavaScript runtime error: Unable to get property 'parentNode' of undefined or null reference

The error is in the following code (3rd line)

},_isWindowRightToLeft:function(){var d=this._isRightToLeft;

if(d==null){var c=this.get_element();

var e=c.parentNode?c:this._getDefaultParent();

d=this._isRightToLeft=$telerik.isRightToLeft(e);

}return d;

},_createStatusbarResizer:function(c){if(this.ui){this.ui.createStatusbarResizer();

}},_createStatusbarMessageCell:function(e){var f=e.rows[0].insertCell(-1);

f.style.width="100%";


My code is similar to the code in the sample

http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx#qsf-demo-source

I have a nestedviewtemplate in a radgird that then has a radgrid in the nestedveiwtemplate.  This inner radgrid has a linkbutton in one of the columns that calls a javascript that does a MyRadWindow.show(); 

The  MyRadWindow is positioned in the aspx code just after the main radgrid.

I cannot seem to find any info about similar issues.  Any suggestions to finding the cause of this issue?

Thanks

2 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 13 Dec 2013, 07:44 PM
The one other unique thing that I forgot to mention is that the radgrid and radwindow are in a user control.  The form itself doesn't have any radwindows.

Thanks,
Andy
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2013, 10:47 AM
Hi  Andy,

Please  have a look into the following code snippet which works fine at my end.

ASCX:
<telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1"
    runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
    AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true" OnItemCreated="RadGrid1_ItemCreated"
    OnItemCommand="RadGrid1_ItemCommand">
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="EmployeeID" AllowMultiColumnSorting="True"
        GroupLoadMode="Server">
        <NestedViewTemplate>
               ...
        </NestedViewTemplate>
        <Columns>
                 ...
            <telerik:GridTemplateColumn HeaderText="Book">
                <ItemTemplate>
                    <asp:LinkButton ID="BookButton" runat="server" Text="Book Now" OnClientClick="OnClientClick();return false;" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
</telerik:RadWindowManager>
<telerik:RadWindow ID="RadWindow1" runat="server" Title="User List Dialog"
    Height="500px" Width="300px" Left="150px" />

JavaScript:
<script type="text/javascript">
    function OnClientClick() {
        radopen(null, "RadWindow1");
                 //or
        var win = $find("<%=RadWindow1.ClientID %>");
        win.show();
    }
</script>

Thanks,
Shinu.
Tags
Window
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or