JavaScript UI-GRID Expandable Grid. Programatically expand one row on click of row ui grid expandable grid example,expandable grid ui-grid

  1. I don't want to use the default, + icon, to expand the row.
  2. Clicking anywhere on the row should expand it.

I tried this:

HTML

<div ui-grid="gridOptions" ui-grid-expandable class="grid">

Controller

var app = angular.module('app',['ngTouch','ui.grid', 'ui.grid.expandable',
          'ui.grid.selection','ui.grid.pagination','ui.bootstrap']);

app.controller('MainCtrl', ['$compile','$scope', '$http', '$log', 
  function ($compile,$scope, $http, $log) {

    $scope.gridOptions = {
      enableRowSelection: true,
      enableHorizontalScrollbar:0,
      expandableRowTemplate: 'expandableRowTemplate.html',
      expandableRowHeight: 150,
      expandableRowScope: {
      subGridVariable: 'subGridScopeVariable'
    },

    onRegisterApi: function (gridApi){
      $scope.gridApi = gridApi;
    },

    rowTemplate: '<div ng-click="grid.api.expandable.toggleRowExpansion(row.entity)" ng-style="{ \’cursor\’: row.cursor }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell {{col.cellClass}}"><div class="ngVerticalBar" ng-style="{height: rowHeight}" ng-class="{ ngVerticalBarVisible: !$last }">&nbsp;</div><div ng-cell></div></div>'
  }
}]);

Note: When I use rowTemplate, nothing is displayed. However, when it's removed, the rows aren't clickable.

Answer:1

I know it seems like a duplicate but it isn't. Nothing worked, whatever I tried. I have a list in my angular module: this.checkedInterviews = [] and then a function that does: var interviewModel = ...

I know it seems like a duplicate but it isn't. Nothing worked, whatever I tried. I have a list in my angular module: this.checkedInterviews = [] and then a function that does: var interviewModel = ...

I want to append div based on dragend event coordinates. This is what I have tried: $(document).ready(function () { var mouseX; var mouseY; $(document).mousemove(...

I want to append div based on dragend event coordinates. This is what I have tried: $(document).ready(function () { var mouseX; var mouseY; $(document).mousemove(...

I have succesfully implemented the DataTables (version 1.10+) pagination plugin with textbox but I would like to allow the user to first enter a page number and then to press the enter key. By default,...

I have succesfully implemented the DataTables (version 1.10+) pagination plugin with textbox but I would like to allow the user to first enter a page number and then to press the enter key. By default,...

Lets say I have two pages on my website, Home and Settings. A user visits Home, then presses Settings. They decide to go back to Home via the back button, or pressing escape on the key board, or ...

Lets say I have two pages on my website, Home and Settings. A user visits Home, then presses Settings. They decide to go back to Home via the back button, or pressing escape on the key board, or ...

  1. react lifecycle method before render
  2. react lifecycle method after render
  3. react lifecycle method order
  4. react lifecycle method when props change
  5. react lifecycle methods list
  6. react lifecycle methods explained
  7. react lifecycle methods diagram
  8. react lifecycle methods hooks
  9. react lifecycle methods 2020
  10. react lifecycle methods vs hooks
  11. react lifecycle methods 2019
  12. react lifecycle methods chart
  13. react lifecycle methods tutorial
  14. react lifecycle methods medium
  15. react lifecycle methods async
  16. react lifecycle methods 16.8
  17. react lifecycle methods update state
  18. react lifecycle methods interview questions
  19. react lifecycle methods in functional components
  20. react lifecycle methods deprecated