Change click event to work in chrome src/app/searchPages/searchUtils/advancedSearchForm.component.ts

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45538 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2017-01-23 13:51:33 +00:00
parent ec3a51b5b4
commit 451951a3c0
1 changed files with 7 additions and 33 deletions

View File

@ -15,10 +15,10 @@ import {Dates} from '../../utils/string-utils.class';
<td *ngIf ="i==0 ">Search for:</td> <td *ngIf ="i==0 ">Search for:</td>
<td *ngIf = "i != 0" ><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" > <td *ngIf = "i != 0" ><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" >
<option *ngFor="let op of operators" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option> <option *ngFor="let op of operators" (change)="fieldOperatorChanged(i, op.id, op.id)" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option>
</select></td> </select></td>
<td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" > <td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" >
<option *ngFor="let id of fieldIds" (click)="fieldIdsChanged(i, id)" [value]="id">{{fieldIdsMap[id].name}}</option> <option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}}</option>
</select> </td> </select> </td>
<td *ngIf = "selectedField.type == 'keyword'" class="uk-width-1-3" ><input type="text" class="form-control" placeholder="Type keywords..." <td *ngIf = "selectedField.type == 'keyword'" class="uk-width-1-3" ><input type="text" class="form-control" placeholder="Type keywords..."
[(ngModel)]="selectedField.value" name="value[{{i}}]"></td> [(ngModel)]="selectedField.value" name="value[{{i}}]"></td>
@ -58,28 +58,6 @@ import {Dates} from '../../utils/string-utils.class';
</button></td> </button></td>
</tr> </tr>
</table> </table>
<div class="uk-form-row ">
<!--div data-uk-dropdown="{mode:'click'}" aria-haspopup="true" aria-expanded="false" class="uk-button-dropdown">
<button class="uk-button"> {{fieldIdsMap[newFieldId].name}} <i class="uk-icon-caret-down"></i></button>
<div class="uk-dropdown uk-dropdown-bottom" aria-hidden="true" style="top: 30px; left: 0px;" tabindex="">
<ul class="uk-nav uk-nav-dropdown">
<li *ngFor="let id of fieldIds">
<a (click)="fieldIdsChanged(i, id)">{{fieldIdsMap[id].name}}</a>
</li>
</ul>
</div>
</div-->
<!--select [(ngModel)]="newFieldId" name="selectField" >
<option *ngFor="let id of fieldIds" (click)="newFieldIdsChanged(i, id)" [value]="id">{{fieldIdsMap[id].name}}</option>
</select>
<button type="button" class="uk-button uk-button-success" (click)="addField()">
<i class="uk-icon-plus"></i>
</button-->
</div>
<div class="uk-form-row uk-text-right"> <div class="uk-form-row uk-text-right">
<button (click)="queryChanged()" type="submit" class="uk-button uk-button-primary">Search</button> <button (click)="queryChanged()" type="submit" class="uk-button uk-button-primary">Search</button>
</div> </div>
@ -88,7 +66,6 @@ import {Dates} from '../../utils/string-utils.class';
` `
}) })
///[style.width]="'120px'"
export class AdvancedSearchFormComponent { export class AdvancedSearchFormComponent {
@Input() entityType; @Input() entityType;
@Input() fieldIds: string[]; @Input() fieldIds: string[];
@ -148,9 +125,8 @@ export class AdvancedSearchFormComponent {
this.selectedFields[index].valid = Dates.isValidYear(value); this.selectedFields[index].valid = Dates.isValidYear(value);
} }
fieldIdsChanged(index: number,id) { fieldIdsChanged(index: number) {
console.info('changed: index'+index+" id :"+id); var id =this.selectedFields[index].id;
this.selectedFields[index].id = id;
this.selectedFields[index].name = this.fieldIdsMap[id].name; this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type; this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = ""; this.selectedFields[index].value = "";
@ -158,8 +134,6 @@ export class AdvancedSearchFormComponent {
if(this.fieldIdsMap[id].type == "boolean"){ if(this.fieldIdsMap[id].type == "boolean"){
this.selectedFields[index].value = "true"; this.selectedFields[index].value = "true";
} }
console.info('changed:' +this.selectedFields[index].name+" "+this.selectedFields[index].type+" "+ this.selectedFields[index].param );
} }
valueChanged($event,index:number){ valueChanged($event,index:number){
this.selectedFields[index].value = $event.value; this.selectedFields[index].value = $event.value;