Skip to content

Commit b15f239

Browse files
committed
Boolean type filter
1 parent 2ad23f2 commit b15f239

File tree

5 files changed

+253
-217
lines changed

5 files changed

+253
-217
lines changed

db/sample-data.sql

Lines changed: 3 additions & 2 deletions
Large diffs are not rendered by default.

ng/src/app/app.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929

3030
<p-columnFilter *ngIf="col.searchable && col.type==='string'" type="text" [field]="col.field" display="menu" matchMode="contains"></p-columnFilter>
3131

32-
<p-columnFilter *ngIf="col.searchable && col.type==='number'" type="numeric" [field]="col.field" display="row"></p-columnFilter>
32+
<p-columnFilter *ngIf="col.searchable && col.type==='number'" type="numeric" [field]="col.field" display="row"></p-columnFilter>
33+
34+
<p-columnFilter *ngIf="col.searchable && col.type==='decimal'" type="numeric" [minFractionDigits]="2" [maxFractionDigits]="2" [field]="col.field" display="row"></p-columnFilter>
3335

3436
<p-columnFilter *ngIf="col.searchable && col.type==='date'" type="date" [field]="col.field" display="row" matchMode="is"></p-columnFilter>
3537

ng/src/app/app.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ export class AppComponent {
1212
columnsDefs = [
1313
{ field: 'id', header: 'Id', sortable: true, searchable: true, type: "number" },
1414
{ field: 'username', header: 'Username', sortable: true, searchable: true, type: "string" },
15-
{ field: 'firstname', header: 'FirstName', sortable: true, searchable: true, type: "string" },
15+
//{ field: 'firstname', header: 'FirstName', sortable: true, searchable: true, type: "string" },
1616
{ field: 'lastname', header: 'LastName', sortable: true, searchable: true, type: "string" },
17-
{ field: 'email', header: 'Email', sortable: true, searchable: true, type: "string" },
17+
//{ field: 'email', header: 'Email', sortable: true, searchable: true, type: "string" },
1818
{ field: 'accessdate', header: 'date', sortable: true, searchable: true, type: "date" },
19-
{ field: 'modified', header: 'boolean', sortable: true, searchable: true, type: "boolean" }
19+
{ field: 'modified', header: 'boolean', sortable: true, searchable: true, type: "boolean" },
20+
{ field: 'account', header: 'Decimal', sortable: true, searchable: true, type: "decimal" }
21+
22+
2023
];
2124

2225
settings = {

src/main/java/org/nd/primeng/model/User.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public class User {
3535
@Column()
3636
private Boolean modified;
3737

38+
@Column()
39+
private Float account;
40+
3841
public long getId() {
3942
return id;
4043
}
@@ -90,4 +93,12 @@ public Boolean getModified() {
9093
public void setModified(Boolean modified) {
9194
this.modified = modified;
9295
}
96+
97+
public Float getAccount() {
98+
return account;
99+
}
100+
101+
public void setAccount(Float account) {
102+
this.account = account;
103+
}
93104
}

0 commit comments

Comments
 (0)