Hi Guys,
We have a grid with 2 nested child grids. Originally we had used load on demand but the users wanted an auto-expand feature. So we have added an autoexpand function to loop through and expand where possible. The result is really slow and IE is throwing a "Stop running this script" warning.
I looked at the rendered code and noticed that there is a hell of a lot of javascript being created
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadGrid, {"ClientID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1","ClientSettings":{"AllowAutoScrollOnDragDrop":true,"ShouldCreateRows":true,"DataBinding":{},"Selecting":{"CellSelectionMode":0},"Scrolling":{},"Resizing":{},"ClientMessages":{},"KeyboardNavigationSettings":{"AllowActiveRowCycle":false,"EnableKeyboardShortcuts":true,"FocusKey":89,"InitInsertKey":73,"RebindKey":82,"ExitEditInsertModeKey":27,"UpdateInsertItemKey":13,"DeleteActiveRow":127,"ExpandDetailTableKey":39,"CollapseDetailTableKey":37},"Animation":{}},"Skin":"Default","UniqueID":"ctl00$CPH1$m_radgrdLevelHICL$ctl00$ctl63$m_radgrdLevel1","_activeRowIndex":"","_controlToFocus":"","_currentPageIndex":0,"_editIndexes":"[]","_embeddedSkin":true,"_gridTableViewsData":"[{\"ClientID\":\"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ctl00\",\"UniqueID\":\"ctl00$CPH1$m_radgrdLevelHICL$ctl00$ctl63$m_radgrdLevel1$ctl00\",\"PageSize\":10,\"PageCount\":1,\"EditMode\":\"EditForms\",\"AllowPaging\":false,\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"AllowNaturalSort\":true,\"AllowFilteringByColumn\":false,\"PageButtonCount\":10,\"HasDetailTables\":false,\"HierarchyLoadMode\":\"Client\",\"PagerAlwaysVisible\":false,\"IsItemInserted\":false,\"clientDataKeyNames\":[],\"_dataBindTemplates\":false,\"_selectedItemStyle\":\"\",\"_selectedItemStyleClass\":\"rgSelectedRow\",\"_columnsData\":[{\"UniqueName\":\"ExpandColumn\",\"Resizable\":false,\"Reorderable\":false,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridExpandColumn\",\"DataTypeName\":\"System.String\",\"ExpandImageUrl\":\"\",\"CollapseImageUrl\":\"\",\"Display\":true},{\"UniqueName\":\"CheckboxColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"LinkButtonColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridButtonColumn\",\"DataTypeName\":\"System.String\",\"ButtonType\":\"LinkButton\",\"CommandName\":\"Redirect\",\"CommandArgument\":\"\",\"Text\":\"\",\"DataTextField\":\"CodeNumber\",\"DataTextFormatString\":\"\",\"ImageUrl\":\"\",\"Display\":true},{\"UniqueName\":\"CodeNumber\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"CodeNumber\",\"Display\":true},{\"UniqueName\":\"CodeName\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"CodeDescription\",\"Display\":true},{\"UniqueName\":\"Type\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"Type\",\"Display\":true},{\"UniqueName\":\"IngestDate\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"IngestDate\",\"Display\":true},{\"UniqueName\":\"AddElementColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"DeleteColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true}]}]","_hierarchySettings":{"ExpandTooltip":"Expand","CollapseTooltip":"Collapse","SelfExpandTooltip":"Self reference expand","SelfCollapseTooltip":"Self reference collapse","ViewState":{}},"_masterClientID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ctl00","_shouldFocusOnPage":false,"allowMultiRowSelection":false,"clientStateFieldID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ClientState"}, null, null, $get("ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1"));
});
That code is generated for every child and grandchild grid, can someone explain to me whats happening here and if there is anything I can do to prevent it?
Regards
Ross
We have a grid with 2 nested child grids. Originally we had used load on demand but the users wanted an auto-expand feature. So we have added an autoexpand function to loop through and expand where possible. The result is really slow and IE is throwing a "Stop running this script" warning.
I looked at the rendered code and noticed that there is a hell of a lot of javascript being created
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadGrid, {"ClientID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1","ClientSettings":{"AllowAutoScrollOnDragDrop":true,"ShouldCreateRows":true,"DataBinding":{},"Selecting":{"CellSelectionMode":0},"Scrolling":{},"Resizing":{},"ClientMessages":{},"KeyboardNavigationSettings":{"AllowActiveRowCycle":false,"EnableKeyboardShortcuts":true,"FocusKey":89,"InitInsertKey":73,"RebindKey":82,"ExitEditInsertModeKey":27,"UpdateInsertItemKey":13,"DeleteActiveRow":127,"ExpandDetailTableKey":39,"CollapseDetailTableKey":37},"Animation":{}},"Skin":"Default","UniqueID":"ctl00$CPH1$m_radgrdLevelHICL$ctl00$ctl63$m_radgrdLevel1","_activeRowIndex":"","_controlToFocus":"","_currentPageIndex":0,"_editIndexes":"[]","_embeddedSkin":true,"_gridTableViewsData":"[{\"ClientID\":\"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ctl00\",\"UniqueID\":\"ctl00$CPH1$m_radgrdLevelHICL$ctl00$ctl63$m_radgrdLevel1$ctl00\",\"PageSize\":10,\"PageCount\":1,\"EditMode\":\"EditForms\",\"AllowPaging\":false,\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"AllowNaturalSort\":true,\"AllowFilteringByColumn\":false,\"PageButtonCount\":10,\"HasDetailTables\":false,\"HierarchyLoadMode\":\"Client\",\"PagerAlwaysVisible\":false,\"IsItemInserted\":false,\"clientDataKeyNames\":[],\"_dataBindTemplates\":false,\"_selectedItemStyle\":\"\",\"_selectedItemStyleClass\":\"rgSelectedRow\",\"_columnsData\":[{\"UniqueName\":\"ExpandColumn\",\"Resizable\":false,\"Reorderable\":false,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridExpandColumn\",\"DataTypeName\":\"System.String\",\"ExpandImageUrl\":\"\",\"CollapseImageUrl\":\"\",\"Display\":true},{\"UniqueName\":\"CheckboxColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"LinkButtonColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridButtonColumn\",\"DataTypeName\":\"System.String\",\"ButtonType\":\"LinkButton\",\"CommandName\":\"Redirect\",\"CommandArgument\":\"\",\"Text\":\"\",\"DataTextField\":\"CodeNumber\",\"DataTextFormatString\":\"\",\"ImageUrl\":\"\",\"Display\":true},{\"UniqueName\":\"CodeNumber\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"CodeNumber\",\"Display\":true},{\"UniqueName\":\"CodeName\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"CodeDescription\",\"Display\":true},{\"UniqueName\":\"Type\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"Type\",\"Display\":true},{\"UniqueName\":\"IngestDate\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"IngestDate\",\"Display\":true},{\"UniqueName\":\"AddElementColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"DeleteColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true}]}]","_hierarchySettings":{"ExpandTooltip":"Expand","CollapseTooltip":"Collapse","SelfExpandTooltip":"Self reference expand","SelfCollapseTooltip":"Self reference collapse","ViewState":{}},"_masterClientID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ctl00","_shouldFocusOnPage":false,"allowMultiRowSelection":false,"clientStateFieldID":"ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1_ClientState"}, null, null, $get("ctl00_CPH1_m_radgrdLevelHICL_ctl00_ctl63_m_radgrdLevel1"));
});
That code is generated for every child and grandchild grid, can someone explain to me whats happening here and if there is anything I can do to prevent it?
Regards
Ross