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

Detail not expanding

1 Answer 443 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 10 Jul 2018, 06:40 PM

I have a hierarchical grid that i populate data with 2 page methods. When the page loads the is no problem how ever if i reload the grid the rows wont expand. the detailInit event fires. (if i reload it again after the rows don't expand. then everything loads and functions correctly)

 

function loadGrid(startDate, endDate) {
                $("#rgLeaderBoardByManager").kendoGrid({
                    dataSource: {
                            data: data
                    },                  
                    dataBound: function (e) {
                                    var grid = this;
                                    $(".k-grouping-row").each(function (e) {
                                    grid.collapseGroup(this);
                                    });                  
                    },
                    sortable: true,
                    scrollable: true,
                    detailInit: detailInit,
                    columns: [ 
                        {
                            field: "Manager",
                            title: "Manager"
                        },
                        {
                            field: "TotalSalesByManager",
                            title: "Total Sales"
                        }                                      
                    ]                 
                }); 

                function detailInit(e) {                    
                    var sd1, ed1; 

                    var dateRange = FindControl('<%= rcmLeaderBoardByManagerWidget.ClientID %>').value;

                    switch (dateRange) {
                        case "Today":
                            sd1 = new Date();
                            ed1 = new Date();
                            
                            break;
                        case "Yesterday":
                            sd1 = new Date().Add("D", -1);
                            ed1 = new Date().Add("D", -1);

                            break;
                        case "Week to Date":
                            sd1 = new Date().Add("D", -(new Date().getDay()));
                            ed1 = new Date();
 
                            break;
                        case "Last Week":
                            sd1 = new Date().Add("D", -(new Date().getDay() + 7));
                            ed1 = new Date().Add("D", -(new Date().getDay() + 1));

                            break;
                        case "Month to Date":
                            sd1 = new Date(new Date().getFullYear(), new Date().getMonth(), 1);
                            ed1 =   new Date();

                            break;
                        case "Last Month":
                            var endOfLastMonth = new Date(new Date().getFullYear(), new Date().getMonth(), 1).Add("D", -1);
                            sd1 = new Date(endOfLastMonth.getFullYear());
                            ed1 = endOfLastMonth;
                            
                            break;
                    }

                    CallWidgetHelper("GetLeaderByManagerWidgetData", function (response) {                        
                        $("<div/>").appendTo(e.detailCell).kendoGrid({
                        dataSource: {
                            data: response.d                         
                        },
                        scrollable: false,
                        sortable: true,
                        columns: [
                            { field: "UserFullName" },
                            { field: "TotalSales", title:"User"}                       
                        ]
                        });

                    }, null, "startDate", sd1.format('M/d/yyyy'), "endDate", ed1.format('M/d/yyyy'),
                        "includeCancels", FindControl('<%= hdnIncludeCancels.ClientID %>').value,
                        "includeChecksPending", FindControl('<%= hdnIncludeChecksPending.ClientID %>').value, "managerId", e.data.ManagerId);
                }
            }

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Jul 2018, 06:22 AM
Hello, Justin,

Thank you for the code configuration looks good

Could you please share how the Grid is refreshed, is it using the built-in button inside the pager or using custom button outside of the Grid?

Also, once the Grid is refresh please check if there are any error inside the console.

The other thing that may give us a clue is the network tab, check if the requests made on the initial page load and the responses are the same after the refresh.

If there are no errors and the requests are the same, please share an example reproducing the issue and I will be happy to investigate what could be the reason for the unexpected behavior.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or