Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v2.0' into v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikthecook committed Aug 8, 2017
2 parents 9a4dc2b + 04c0b28 commit 393915f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
36 changes: 18 additions & 18 deletions src/treedatatable/treedatatable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {CommonHttpService} from '../common.http.service';
selector : 'amexio-tree-data-table',
template : `<table class="table table-hover table-bordered ">
<thead>
<tr>
<td [attr.colspan]="columns.length" width="100%" align="right">
Expand Down Expand Up @@ -58,7 +57,7 @@ import {CommonHttpService} from '../common.http.service';
<tr [ngClass]="{'hiderow' : !(viewRows.length > 0),'showrow' : viewRows.length > 0}" *ngFor="let row of viewRows let rowIndex = index" [hidden]="!row.visible" (click)="setSelectedRow(row, $event)">
<td *ngFor="let cols of columns let colIndex = index" [hidden] ="cols.hidden" >
<div style="cursor: pointer;position: relative" *ngIf="colIndex == 0"
<div class="amexio-treedatatable-div" *ngIf="colIndex == 0"
[ngStyle]="{left: row.level*15+'px'}" (click)="toggle(row,rowIndex)">
<span *ngIf="colIndex == 0" class="fa " [ngClass]="{'fa-minus': row.expanded, 'fa-plus': (!row.expanded && row.haschildren)}" aria-hidden="true">
</span>
Expand All @@ -71,44 +70,45 @@ import {CommonHttpService} from '../common.http.service';
</tr>
<tr *ngIf="viewRows.length == 0">
<td colspan="3" style="height: 400px;" class="loading-mask">
<td colspan="3" class="loading-mask amexio-treedatatable-td-height">
</td>
</tr>
</table>`,
providers : [CommonHttpService],
styleUrls: [
'../baseclass/loading-mask.css'
'../baseclass/loading-mask.css',
'treedatatable.custom.css'
]
})

export class TreeDataTableComponent implements OnInit{

@Input() title : string;
@Input() title: string;

@Input() httpUrl : string;
@Input() httpUrl: string;

@Input() httpMethod : string;
@Input() httpMethod: string;

@Input() dataReader : string;
@Input() dataReader: string;

@Input() dataTableBindData : any[];
@Input() dataTableBindData: any[];

@Input() pageSize : number;
@Input() pageSize: number;

@Output() selectedRecord : any = new EventEmitter<any>();
@Output() selectedRecord: any = new EventEmitter<any>();

data : any;
data: any;

viewRows : any[] = [];
viewRows: any[] = [];

columns : any[] = [];
columns: any[] = [];

sortColumn : any;
sortColumn: any;

responseData: any;

constructor (private treeDataTableService : CommonHttpService){
constructor (private treeDataTableService: CommonHttpService){
this.columns.push({text: 'Task', dataIndex: 'task', hidden: false, dataType : 'string'});
this.columns.push({text: 'Duration', dataIndex: 'duration', hidden: false , dataType : 'number'});
this.columns.push({text: 'User', dataIndex: 'user', hidden: false, dataType : 'string'});
Expand All @@ -134,7 +134,7 @@ export class TreeDataTableComponent implements OnInit{

}

ngOnChanges(change : SimpleChange){
ngOnChanges(change: SimpleChange){
if (this.dataTableBindData){
this.setData(this.dataTableBindData);
}
Expand All @@ -150,7 +150,7 @@ export class TreeDataTableComponent implements OnInit{
this.renderData();
}

toggle(rowData : any , rowIndex : number){
toggle(rowData: any , rowIndex: number){
this.toggleViewRows(rowData, !rowData.expanded, this.viewRows);
}

Expand Down
7 changes: 7 additions & 0 deletions src/treedatatable/treedatatable.custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.amexio-treedatatable-td-height{
height: 400px;
}
.amexio-treedatatable-div{
cursor: pointer;
position: relative;
}
10 changes: 5 additions & 5 deletions src/treeview/treeview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ import {CommonHttpService} from '../common.http.service';
selector : 'amexio-tree-view',
template : `
<div *ngIf="data.length== 0">
<div class="loading-mask" style="height: 300px;width: 400px;">
<div class="loading-mask amexio-treeview-loadingmask" >
</div>
</div>
<ul style="list-style-type: none;" *ngIf="data.length > 0">
<ul class="amexio-treeview-ul" *ngIf="data.length > 0">
<li style="cursor: pointer" *ngFor="let treeData of data">
<div >
<span class="fa " [ngClass]="{'fa-minus': treeData.expanded, 'fa-plus': (!treeData.expanded && treeData.children)}" (click)="toggle(treeData)"> </span>
Expand All @@ -43,7 +42,7 @@ import {CommonHttpService} from '../common.http.service';
</div>
<div *ngIf="treeData.expanded && treeData.expanded == true">
<ul style="list-style-type: none;">
<ul class="amexio-treeview-ul">
<li style="cursor: pointer" *ngFor="let leaf of treeData.children">
<div>
<span class="fa " [ngClass]="{'fa-minus': leaf.expanded, 'fa-plus': (!leaf.expanded && leaf.children)}" (click)="toggle(leaf)"> </span>
Expand All @@ -68,7 +67,8 @@ import {CommonHttpService} from '../common.http.service';
</ul>`,
providers : [CommonHttpService],
styleUrls: [
'../baseclass/loading-mask.css'
'../baseclass/loading-mask.css',
'treeview.custom.css'
]
})

Expand Down
7 changes: 7 additions & 0 deletions src/treeview/treeview.custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.amexio-treeview-loadingmask{
height: 300px;
width: 400px;
}
.amexio-treeview-ul{
list-style-type: none;
}

0 comments on commit 393915f

Please sign in to comment.