0

I want to expand the row in the ui grid immediately after populating it with data.

This is the function for populating the data.

    $http({
        url: '/Parameters/GetQuarterJson',
        data: { AccountID: $scope.selectedProject, Year: $scope.selectedYear },
        method: 'POST'
    }).then(function (response) {
        $scope.quarterGrid.data = response.data;
    });

And this is the function which is called based on some condition right after populating data to expand the row.

    $scope.paramerterGridApi.expandable.collapseAllRows();
    var index, rows = $scope.quarterGrid.data;
    //$scope.quarterGrid.data contains the new data

    for (index = 0; index < rows.length; index++) {
        if (rows[index].Quarter === $scope.selectedQuarter) {
            $scope.paramerterGridApi.expandable.expandRow(rows[index]);
         //but $scope.paramerterGridApi.grid.rows doen't contains it

        }
    }

That's why the row doesn't expand. How can i achieve this?

Maxim Shoustin
  • 77,483
  • 27
  • 203
  • 225
Vikas2612
  • 36
  • 4
  • 1
    Can you please create demo in Plunker with your problem? – Maxim Shoustin Oct 06 '17 at 06:38
  • I think it is not possible since the ajax calls are for the ASP MVC action methods which fetches the data from database and process it before returning as Json. If I can make one please tell me how. – Vikas2612 Oct 09 '17 at 12:56

0 Answers0