问题描述
我有一个项目,必须在 AngularJs UI-Grid 中显示数据。
<div ng-app="appDashboard">
<div ng-controller="CategoriesCtrl as $ctrl">
<div ui-grid="$ctrl.gridOptions" class="grid"></div>
</div>
</div>
js 文件:
var app = angular.module('appDashboard',[
'ngAnimate','ngTouch','ui.grid']);
app.controller('CategoriesCtrl',function ($scope,$http,$interval) {
var vm = this;
vm.gridOptions = {};
vm.gridOptions = {
enableSorting: true,columnDefs: [
{ name: 'Id',field: 'Id',visible: false },{ name: 'Name',field: 'Name' }
]
};
$http.get("/Dashboard/GetCategories").then(function (response) {
vm.gridOptions = response.data;
console.log(response.data);
console.log(vm.gridOptions);
});
});
当应用程序运行时,它显示空网格,但在日志数据中成功显示。 我从文档中检查了所有内容,一切都应该是这样,我在代码的任何部分都没有收到任何“错误”或“警告”...
我找不到我的错误在哪里。有人可以帮助我。 提前致谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)