Commit 8703c52392adeb84beb36a21b0b2362678036fcd
1 parent
6bed594a
Exists in
master
แก้ เสริชแล้วลบ ข้อมูลหาย
Showing
2 changed files
with
8 additions
and
5 deletions
Show diff stats
src/app/dashboard/filter.pipe.ts
| @@ -14,22 +14,22 @@ export class FilterPipe implements PipeTransform { | @@ -14,22 +14,22 @@ export class FilterPipe implements PipeTransform { | ||
| 14 | const resultArray = []; | 14 | const resultArray = []; |
| 15 | for (const item of value) { | 15 | for (const item of value) { |
| 16 | console.log('item: ', item); | 16 | console.log('item: ', item); |
| 17 | + | ||
| 17 | var st = ''; | 18 | var st = ''; |
| 18 | // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | 19 | // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; |
| 19 | if(item['team']){ | 20 | if(item['team']){ |
| 20 | - st = st + item['team'].toLowerCase(); | 21 | + st += item['team'].toLowerCase(); |
| 21 | } | 22 | } |
| 22 | if(item['COMMENT']){ | 23 | if(item['COMMENT']){ |
| 23 | - st = st + item['COMMENT'].toLowerCase(); | 24 | + st += item['COMMENT'].toLowerCase(); |
| 24 | } | 25 | } |
| 25 | if(item['custgroupName']){ | 26 | if(item['custgroupName']){ |
| 26 | - st = st + item['custgroupName'].toLowerCase(); | 27 | + st += item['custgroupName'].toLowerCase(); |
| 27 | } | 28 | } |
| 28 | if(item['STATUS']){ | 29 | if(item['STATUS']){ |
| 29 | - st = st + item['STATUS'].toLowerCase(); | 30 | + st += item['STATUS'].toLowerCase(); |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | - | ||
| 33 | var string2 = filterString.toLowerCase(); | 33 | var string2 = filterString.toLowerCase(); |
| 34 | if (st.indexOf(string2) > -1) { | 34 | if (st.indexOf(string2) > -1) { |
| 35 | resultArray.push(item); | 35 | resultArray.push(item); |
src/app/dashboard/short.ts
| @@ -5,6 +5,9 @@ import { PipeTransform, Pipe } from "@angular/core"; | @@ -5,6 +5,9 @@ import { PipeTransform, Pipe } from "@angular/core"; | ||
| 5 | }) | 5 | }) |
| 6 | export class ShortPipe implements PipeTransform { | 6 | export class ShortPipe implements PipeTransform { |
| 7 | transform(value: string): string { | 7 | transform(value: string): string { |
| 8 | + if(value === null){ | ||
| 9 | + value = ''; | ||
| 10 | + } | ||
| 8 | return value.substr(0, 25) + ' ...'; | 11 | return value.substr(0, 25) + ' ...'; |
| 9 | } | 12 | } |
| 10 | } | 13 | } |
| 11 | \ No newline at end of file | 14 | \ No newline at end of file |