1

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 :'(

1
  • Can you clarify what you're wanting to accomplish with your row template? It's going to be hard to tell from just your code samples. Commented Jun 24, 2015 at 15:36

1 Answer 1

1
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

Sign up to request clarification or add additional context in comments.

2 Comments

I had the same issue and your workaround did the trick, but I'm also not sure why.
@ DFB yesterday But now worried about suppose if this was a bug and in future if ng developers fix and i had to do change at all places :'( :'(

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.