angularjs - Angular ui-grid: define columns in template -
the ui-grid documentation tells define columns in controller, this:
$scope.gridoptions = { columndefs: [ { field: 'id', displayname: 'ref', width: "60" }, { field: 'title', displayname: 'title', width: "200" } ] }
while works fine, feel belongs in template. there way setup columns this:
<div ui-grid="gridoptions" class="mygrid" style="width:800px; height: 600px"> <ui-column field="id" width="60">ref</ui-column> <ui-column field="title" width="200">title</ui-column> </div>
Comments
Post a Comment