0

I have use case where I need to change sub grid url anyone knows how to do that. I tried solution given at Dynamically Change the Grid Options in angular ui.grid ,but its not working for sub grid.

Other option left is to use two grids, if anyone knows answer using single grid that would be great help. Thanks

1 Answer 1

0

I managed to do above by some work around like this -

Use the grid option like this

var handler = handler1; // Initially url1 will be used for subgrid

handler1 = function(row){if (row.isExpanded) { ... }} // Use url1
handler2 = function(row){if (row.isExpanded) { ... }} // Use url2

$scope.gridOption = {
...
onRegisterApi: function(gridApi) {
      $scope.gridApi = gridApi;
      gridApi.expandable.on.rowExpandedStateChanged($scope, function(row) {
      handler(row)
      }
)}}

Then change the 'handler' variable to 'handler2' or 'handler1' based on flow.

handler = handler2; // url2 will be used now for subgrid
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.