ASP.Net Boilerplate & jTable

1.1k views Asked by At

I have studied the ASP.Net boilderplate template (http://www.aspnetboilerplate.com/Templates) and made some custom changes. I have a "GetComponentDataList()" method in my services. I played around with that and rendered it as a list like shown here:

 <!-- 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 code:

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;
               })

           );
        };

Now I would like to render the components via jTable. jTable expects an action to get the list of data:

listAction: '/api/services/app/componentData/GetComponentDataList',

How do I use jTable from boilerplate template?

     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?

Any hint would be awesome.

Thx.

1

There are 1 answers