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

RadTreeList with PagerTemplate - javascript error

1 Answer 16 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 25 Mar 2014, 08:41 AM
Hi all

I use the RadTreeList  component with a custom Pager component (PagerTemplate).
But when booting the root page in a browser error occurs: 

TypeError: this._events is null

 However, if I remove the custom Pager component  this error is not reproduced 
Someone can vary help in solving this prolemy?

Code:

                        <telerik:RadTreeList ID="rdTree" runat="server" 
                            DataKeyNames="Location" ParentDataKeyNames="ParentLocation"
                            GridLines="None" Skin="EchopassTreeListSkin" EnableEmbeddedSkins="false"
                            AllowPaging="True" AutoGenerateDeleteColumn="True"
                            AutoGenerateEditColumn="True" AllowAutomaticDeletes="false"
                            AllowAutomaticUpdates="false" 
                            AutoGenerateColumns="False"
                            AllowSorting="True" OnNeedDataSource="rdTree_NeedDataSource"
                            PageSize="50" OnItemDataBound="rdTree_ItemDataBound"
                            OnItemCommand="rdTree_ItemCommand"
                            >
                            <Columns>
                                                    /* ----------- */
                            </Columns>
                            <ClientSettings>
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"></Scrolling>
                            </ClientSettings>
                            <EditFormSettings EditFormType="Template" PopUpSettings-Height="280px" PopUpSettings-Width="900px">
                                <FormTemplate>
                                    <table style="width: 700px; padding: 10px">
                                        <tr>
                                            <td colspan="6" style="height: 20px">
                                                <asp:Label ID="lblBanner" runat="server" CssClass="boldLabel"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblName" runat="server" CssClass="boldLabelxSmall"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtName" runat="server" CssClass="width200"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblDescription" runat="server" CssClass="boldLabelxSmall"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" CssClass="width200"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="lnkCancel" runat="server" CssClass="btnGeneral_grid"
                                                     Text="Cancel" CommandName="Cancel"></asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="lnkGo" runat="server"></asp:LinkButton>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblPhoneNumber" runat="server" Text="Phone Number:" CssClass="boldLabelxSmall">
                                                </asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadNumericTextBox ID="txtFloorNumber" runat="server" Width="40px" MinValue="1"
                                                 NumberFormat-DecimalDigits="0"></telerik:RadNumericTextBox>    
                                            </td>
                                            <td>
                                                <telerik:RadMaskedTextBox ID="txtPhoneNumber" SelectionOnFocus="CaretToBeginning" 
                                                runat="server" Mask="(###) ###-####" Width="80px"></telerik:RadMaskedTextBox>
                                            </td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                        </tr>                                        
                                    </table>
                                </FormTemplate>
                            </EditFormSettings>

                            <PagerStyle AlwaysVisible="true" Position="TopAndBottom" />
                            <PagerTemplate>
                                <asp:Panel ID="PagerPanel" Style="padding: 6px; line-height: 24px" runat="server">
                                    <div style="float: left;">
                                        <span style="margin-right: 3px;">Page size:</span>
                                        <telerik:RadNumericTextBox ID="txtPageSize" runat="server" Style="margin-right: 20px;" Width="40px"
                                            Value='<%# (int)DataBinder.Eval(Container, "Paging.PageSize") %>'>
                                            <ClientEvents OnValueChanged="txtPageSize_ValueChanged" />
                                            <NumberFormat DecimalDigits="0" />
                                        </telerik:RadNumericTextBox>

                                    </div>
                                    <div style="margin: 0px; float: right;">
                                                    Displaying page
                                        <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                                        of
                                        <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                                        , items
                                        <%# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
                                        to
                                        <%# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
                                        of
                                        <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>
                                    </div>
                                    <div style="width: 400px; margin: 0px; padding: 0px; float: left; margin-right: 10px; white-space: nowrap;">
                                        <asp:Button ID="Button1" runat="server"
                                            CommandName="Page" CommandArgument="First" Text=" " CssClass="PagerButton FirstPage" />
                                        <asp:Button ID="Button2" runat="server"
                                            CommandName="Page" CommandArgument="Prev" Text=" " CssClass="PagerButton PrevPage" />
                                        <span style="vertical-align: middle;">Page:</span>
                                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" Width="25px" Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'
                                            runat="server">
                                            <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" />
                                            <NumberFormat DecimalDigits="0" />
                                        </telerik:RadNumericTextBox>
                                        <span style="vertical-align: middle;">of
                                <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                                        </span>
                                        <asp:Button ID="Button3" runat="server"
                                            CommandName="Page" CommandArgument="Next" Text=" " CssClass="PagerButton NextPage" />
                                        <asp:Button ID="Button4" runat="server"
                                            CommandName="Page" CommandArgument="Last" Text=" " CssClass="PagerButton LastPage" />
                                    </div>
                                    <asp:Panel runat="server" ID="NumericPagerPlaceHolder" />
                                </asp:Panel>
                            </PagerTemplate>
                        </telerik:RadTreeList>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 28 Mar 2014, 09:24 AM
Hello Alex,

I would suggest you to review the online demo below which demonstrates the proper implementation of PagerTemplate in RadTreeList control:

http://demos.telerik.com/aspnet-ajax/treelist/examples/paging/pagertemplate/defaultcs.aspx

Test it on your and verify what the difference in your case is.


Regards,
Maria Ilieva
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
TreeView
Asked by
Alex
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or