RLS RLS - 6 months ago 25
AngularJS Question

How can I display a grid repeater using ui-grid?

I have data of messages including

{id,message,date}
.
I would like to display a grid for each Date with
data{message}
in AngularJs using ui-grid

I was thinking of something like this:



<div ng-repeat="(key, value) in data.messages | groupBy: 'date'">
<div>{{ key }}</div>
<div id="grid1" ui-grid="value" class="grid"></div>
</div>





but it's not working!

Answer

ui-grid attribute recieves a gridOptions object containing several parameters. Two of them are:

  1. columnDefs - defining the columns and their data-binding.
  2. data - the message objects in your case.

Look at the the documentation for further study: http://ui-grid.info/docs/#/tutorial