我研究过ASP.Net boilderplate模板(http://www.aspnetboilerplate.com/Templates)并进行了一些自定义更改。 我有一个" GetComponentDataList()"我服务中的方法。我玩弄了它并将其渲染为如下所示的列表:
<!-- Component list -->
<ul class="list-group" ng-repeat="component in vm.components">
<div class="list-group-item">
<br />
<span>Entry:</span>
<span>{{component.entry}}</span>
</div>
</ul>
components.js代码:
vm.refreshComponents = function () {
abp.ui.setBusy( //Set whole page busy until getComponentDataList complete
null,
componentDataService.getComponentDataList( //Call application service method directly from javascript
).success(function (data) {
vm.components = data.componentData;
})
);
};
现在我想通过jTable渲染组件。 jTable期望一个动作来获取数据列表:
listAction: '/api/services/app/componentData/GetComponentDataList',
如何在样板模板中使用jTable?
1. Do I need to add a method in my "HomeController" to use jTable?
2. The result of my "GetComponentDataList" method in my service is of type IOutputDto.
That means the result of my service is not directly a list. There is one indirection
level inbetween. Seems like this does not fit together.
3. Can I provide a function in my JS-ViewModel and use that function instead of an action URL?
任何暗示都会很棒。
THX。
答案 0 :(得分:1)
我正在研究一个使用jTable工作ABP的示例项目。我还没完成它。但你可以检查一下。 https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/AbpWithjTable
在所有ABP和jtable脚本之后,将abp.jtable.js添加到您的文件(https://github.com/aspnetboilerplate/aspnetboilerplate-samples/blob/master/AbpWithjTable/AbpjTable.Web/App/Main/libs/abp.jtable.js)。