Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
MarcelMerz
New Contributor

app.field().getData() Synchron?

 

Hi i`m trying to build a extension where you can select values of a selected Field.

For that i tried to run with the following code.

html += '<select class="field_dropdown_comment_input">';
													
	var selected_Field = this.propsFieldnameDropdown;
	//GET ALL VALUES OF FIELD
	var myField = app.field(selected_Field).getData();
	console.log(myField.rowCount);

	myField.OnData.bind( function(){
		myField.rows.forEach(function(row){
			html += '<option value="' + row.qText + '">' + row.qText + '</option>';
			console.log(row.qText);
		});
	});		
html += '</select>';

My Problem is that app.field().getData() is asynchron. For that reason my HTML Select has no options to select. 

My question is how to solve this problem. I need to get all Values of a Field synchon and display all options in my HTML Select.

 

thank you in advance

 

Labels (2)