Angular Formly ui grid with gridOptions

时间:2015-12-18 20:00:32

标签: angular-ui-grid angular-formly

关注 very basic example of how to use the UI Grid with angular-formly

我正在尝试向网格添加过滤功能,但不确定如何连接gridOptions。

Tutorial: 103 Filtering

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

<div id="grid1" ui-grid="gridOptions" class="grid"></div>

使用Formly ui-grid设置为完全不同的

  app.run(function(formlyConfig) {
    formlyConfig.setType({
      name: 'ui-grid',
      template: '<div ui-grid="{ data: model[options.key] }" ui-grid-auto-    resize ui-grid-pagination ui-grid-selection ui-grid-edit ui-grid-row-edit></div>',
  wrapper: ['bootstrapLabel', 'bootstrapHasError']
   });

});

如何让Formly ui网格使用gridOptions?

1 个答案:

答案 0 :(得分:2)

想出来 -

app.run(function (formlyConfig) {
    formlyConfig.setType({
        name: 'ui-grid',
        template: '<div ui-grid="{ enableFiltering: true, data: model[options.key]}" ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-edit ui-grid-row-edit></div>',
        wrapper: ['bootstrapLabel', 'bootstrapHasError']
    });
});