mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 11:36:48 +00:00
Merge pull request #68 from goutham-M/mifosx-datatables
data table info is added to view client
This commit is contained in:
commit
41dd1ea8ed
@ -100,6 +100,39 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</tab>
|
||||
<tab heading="{{clientdatatable.registeredTableName}}" ng-repeat="clientdatatable in clientdatatables" select="dataTableChange(clientdatatable)">
|
||||
<span ng-show="!datatabledetails.isData || datatabledetails.isMultirow" class="pull-right "><a href="#" class="btn btn-primary"><i class="icon-plus icon-white"></i></a></span></br>
|
||||
<table class="table" ng-show="datatabledetails.isMultirow">
|
||||
<thead>
|
||||
<th ng-repeat="column in datatabledetails.columnHeaders">{{column.columnName}}</th>
|
||||
<th>{{'table.heading.actions' | translate}}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="data in datatabledetails.data">
|
||||
<td ng-repeat="row in data.row">
|
||||
{{row}}
|
||||
</td>
|
||||
<td>
|
||||
<i class="icon-edit"></i>
|
||||
<i class="icon-remove"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div ng-show="!datatabledetails.isMultirow">
|
||||
<span class="pull-right" ng-show="datatabledetails.isData">
|
||||
<i class="icon-edit"></i>
|
||||
<i class="icon-remove"></i>
|
||||
</span>
|
||||
<table ng-show="!datatabledetails.isMultirow" width="100%">
|
||||
<tr ng-repeat="column in datatabledetails.columnHeaders">
|
||||
<td width="30%">{{column.columnName}}:</td>
|
||||
<td width="70%" valign="top">{{column.value}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<tab heading="Notes">
|
||||
<div ng-repeat="clientNote in clientNotes">
|
||||
<div>
|
||||
|
||||
@ -28,8 +28,24 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
resourceFactory.DataTablesResource.getAllDataTables({apptable: 'm_client'} , function(data) {
|
||||
scope.clientdatatables = data;
|
||||
});
|
||||
|
||||
scope.dataTableChange = function(clientdatatable) {
|
||||
resourceFactory.DataTablesResource.getTableDetails({datatablename: clientdatatable.registeredTableName,
|
||||
clientId: routeParams.id, genericResultSet: 'true'} , function(data) {
|
||||
scope.datatabledetails = data;
|
||||
scope.datatabledetails.isData = data.data.length > 0 ? true : false;
|
||||
scope.datatabledetails.isMultirow = data.columnHeaders[0].columnName == "id" ? true : false;
|
||||
if(!scope.datatabledetails.isMultirow && scope.datatabledetails.isData > 0) {
|
||||
for(var i=0; i<data.columnHeaders.length; i++) {
|
||||
scope.datatabledetails.columnHeaders[i].value = data.data[0].row[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scope.isNotClosed = function(loanaccount) {
|
||||
if(loanaccount.status.code === "loanStatusType.closed.written.off" ||
|
||||
loanaccount.status.code === "loanStatusType.rejected") {
|
||||
|
||||
@ -34,6 +34,10 @@
|
||||
clientTemplateResource: defineResource(apiVer + "/clients/template", {}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
}),
|
||||
DataTablesResource: defineResource(apiVer + "/datatables/:datatablename/:clientId", {datatablename:'@datatablename',clientId:'@clientId'}, {
|
||||
getAllDataTables: {method: 'GET', params: {}, isArray:true},
|
||||
getTableDetails: {method: 'GET', params: {}}
|
||||
}),
|
||||
loanProductResource: defineResource(apiVer + "/loanproducts/:loanProductId", {loanProductId:'@loanProductId'}, {
|
||||
getAllLoanProducts: {method: 'GET', params: {}, isArray:true}
|
||||
}),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user