HkFreaKuser1673718
HkFreaKuser1673718

Reputation: 747

Using rowTemplate in Ui.grid is disabling selection in angularjs

I was using ng-grid to show my data in my angularJs project since 6 months now and recently i am trying to use ui.grid instead ng-grid.I am finding it difficulty in implementing the row template that was present on my old ng-grid page.The issue is after putting rowtemplate the I am not able to select any row in my ui.grid :'(.

    $scope.gridOptions = {
    /*other statements */
    rowTemplate : '<div myCustomDirective attributes="gender" ng-model="gridOptions.selectedItems" g-style="{ \'cursor\': row.cursor}"><div class="ngVerticalBar" ng-style="{height:rowHeight}" ng-class"{ngVerticalBarVisible:!$last}"></div><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" ui-grid-cell></div></div>'
 /*other statements*/
  };

here is my plunker example edit example in plunker of my issue please help me with this issue. When i google i am only getting simple celltemplates no links or examples related to custom directive+rowTemplate :'(

Upvotes: 1

Views: 1182

Answers (1)

HkFreaKuser1673718
HkFreaKuser1673718

Reputation: 747

rowTemplate : '<div myCustomDirective attributes="gender" ng-model="gridOptions.selectedItems" g-style="{ \'cursor\': row.cursor}" <div ng-repeat="col in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ui-grid-cell></div></div>'

please note that i removed the '>' bracket at the beginning of 2nd div and i was able to select the rows which was not possible before.

Is this some kind of bug or what i am a beginner in Html/Javascript

This seems right to me

<div>
  <div></div>
</div>

rather than

<div <div></div></div>

Someone please explain

Upvotes: 1

Related Questions