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

[Solved] Out of stack space in IE

1 Answer 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pham
Top achievements
Rank 1
Pham asked on 27 May 2013, 02:48 AM
Hi everybody,
I have a problem when use javascript. I used:   sender.get_masterTableView().fireCommand("Page", "First") in my code. It work in Firefox or google chorme, but it is not work in internet explore. This is error out of stack space int IE. Have any ideas?
Thanks you very much!
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
 
    function rowSelected(sender, args) {           
         if(args.get_commandName() == "SelectCommand")
    {
        var itemIndexHierarhical = +args.get_commandArgument();       
        var item = args.get_tableView().get_dataItems()[itemIndexHierarhical];
        var name = item.getDataKeyValue("MA_DV");
        Service_Test.Web_TITLE_CHITIET(name);            
    }     
    <%Session["CHILD_MADVIQLY"] = "OK";%>     
    sender.get_masterTableView().fireCommand("Page", "First");
    return false;
    }    
 
      
</script>
</telerik:RadCodeBlock>
<div style="width: 100%; height: 100% ; ">
    <table style="width: 100%; height: 100% ; ">
        <tr style="width: 100%; height: 100%">
            <td style="width:100%; height: 100%">
                <telerik:RadGrid ID="rgdBieu2" runat="server" GridLines="None"  OnCustomAggregate="rgdBieu2_CustomAggregate"
                    AutoGenerateColumns="False" ShowFooter="false" OnItemDataBound="RadGrid2_ItemDataBound"
                    AllowMultiRowSelection="True" Skin="Windows7"
                    onitemcommand="rgdBieu2_ItemCommand" >
                    <MasterTableView DataKeyNames = "HIEN_THI,NONGLAM,TEN_DV,CONGNGH,THUONGNGH,TIEUDUNG,KHAC,CKY,TCONG" NoMasterRecordsText="Không có dữ liệu" AutoGenerateColumns="False"  ClientDataKeyNames="MA_DV" Height="10px" Width="100%" EnableNoRecordsTemplate="true" >
                   
                  <SortExpressions>
                   <telerik:GridSortExpression FieldName="NewOrder" SortOrder="Ascending"/>
                    
                  </SortExpressions>
                     <NoRecordsTemplate>
                                Không có dữ liệu
                    </NoRecordsTemplate>
                     
                    <RowIndicatorColumn Visible="True">
                </RowIndicatorColumn>
                     <Columns>
                            <telerik:GridBoundColumn   HeaderText="Mã đơn vị" DataField="MA_DV" UniqueName="MA_DV" FooterText="Tổng" Visible="false"
                                HeaderStyle-Width="12%">
                                 
                                <HeaderStyle Width="12%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"  />
                                  <FooterStyle HorizontalAlign="Center" Font-Bold="true"/>
                            </telerik:GridBoundColumn>                        
                            <telerik:GridBoundColumn Visible="false" HeaderText=" " DataField = "TEN_DV">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                                
                           <telerik:GridButtonColumn HeaderText="Tên đơn vị" DataTextField = "TEN_DV" UniqueName="TEN_DV" Visible="false"
                                CommandName="SelectCommand">
                                <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                               
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn Visible="false" HeaderText="Tên đơn vị" DataField = "BUTTON">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                            <telerik:GridButtonColumn HeaderText="Tên đơn vị" DataTextField = "BUTTON" UniqueName="HIEN_THI" FooterText="Tổng"
                                CommandName="SelectCommand">
                                <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            <FooterStyle HorizontalAlign="left" Font-Bold="true"/>
                            </telerik:GridButtonColumn>
                              <telerik:GridBoundColumn Visible="true" HeaderText="" DataField = "HIEN_THI" UniqueName="HIEN_THI">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                             
                    
                        </Columns>
                    </MasterTableView>
                    <ClientSettings  AllowColumnsReorder="false" ReorderColumnsOnClient="true" EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                        <Selecting AllowRowSelect="false" />
                        <Scrolling AllowScroll="false" UseStaticHeaders="true" />
                       <ClientEvents OnCommand="rowSelected" />
                    </ClientSettings>
                    <GroupingSettings ShowUnGroupButton="false" />
                </telerik:RadGrid>
            </td>
        </tr>       
    </table>
</div>

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 29 May 2013, 12:32 PM
Hi DucAnh,

I noticed that you are actually hooked OnCommand client event and call fireCommand method. Note after you first call the fireCommand method the rowSelected function will be executed again and again. Basically you will end up in an infinite loop. I would suggest you to check whether the corresponding command is not Page and only in this case to call fireCommand. Check out the following code snippet.
function rowSelected(sender, args) {
                    debugger;
                    if (args.get_commandName() == "SelectCommand") {
                        var itemIndexHierarhical = +args.get_commandArgument();
                        var item = args.get_tableView().get_dataItems()[itemIndexHierarhical];
                        var name = item.getDataKeyValue("MA_DV");
                        Service_Test.Web_TITLE_CHITIET(name);
                    }
 
                    <%Session["CHILD_MADVIQLY"] = "OK";%>
                    if (args.get_commandName() != "Page")
                        sender.get_masterTableView().fireCommand("Page", "First");
                    return false;
                }

Regards,
Kostadin
Telerik
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.
Tags
Grid
Asked by
Pham
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or