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,11 +15,11 @@ import {Dates} from '../../utils/string-utils.class';
<td *ngIf ="i==0 ">Search for:</td>
<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>
</select></td>
<td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" >
<option *ngFor="let id of fieldIds" (click)="fieldIdsChanged(i, id)" [value]="id">{{fieldIdsMap[id].name}}</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>
<td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" >
<option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}}</option>
</select> </td>
<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>
<td *ngIf = "selectedField.type == 'year'" class="uk-width-1-3"><input type="text" class="form-control" placeholder="Type Year..."
@ -30,7 +30,7 @@ import {Dates} from '../../utils/string-utils.class';
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
(selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete>
</td>
<td *ngIf = "selectedField.type == 'refine'" class="uk-width-1-3">
<td *ngIf = " selectedField.type == 'refine'" class="uk-width-1-3">
<static-autocomplete [(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [fieldName] = [selectedField.id] [selectedValue]=selectedField.value [showSelected]=true [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete></td>
<td *ngIf = "selectedField.type == 'entity'" class="uk-width-1-3"><entities-autocomplete [entityType]=selectedField.param [selectedValue]=selectedField.value [showSelected]=true
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
@ -58,28 +58,6 @@ import {Dates} from '../../utils/string-utils.class';
</button></td>
</tr>
</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">
<button (click)="queryChanged()" type="submit" class="uk-button uk-button-primary">Search</button>
</div>
@ -88,7 +66,6 @@ import {Dates} from '../../utils/string-utils.class';
`
})
///[style.width]="'120px'"
export class AdvancedSearchFormComponent {
@Input() entityType;
@Input() fieldIds: string[];
@ -148,9 +125,8 @@ export class AdvancedSearchFormComponent {
this.selectedFields[index].valid = Dates.isValidYear(value);
}
fieldIdsChanged(index: number,id) {
console.info('changed: index'+index+" id :"+id);
this.selectedFields[index].id = id;
fieldIdsChanged(index: number) {
var id =this.selectedFields[index].id;
this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = "";
@ -158,8 +134,6 @@ export class AdvancedSearchFormComponent {
if(this.fieldIdsMap[id].type == "boolean"){
this.selectedFields[index].value = "true";
}
console.info('changed:' +this.selectedFields[index].name+" "+this.selectedFields[index].type+" "+ this.selectedFields[index].param );
}
valueChanged($event,index:number){
this.selectedFields[index].value = $event.value;