Multiple dropdown (select tag) through Ajax data in Framework7 v2

Hi All and @nolimits4web ,

I have impressed with Framework7, so thought to develop my application using Framework7 v2.

I have a form page which contains multiple dropdowns where data load from server as JSON. I achieved this through multiple asynchronous app.request on pageInit. Now my question is how can i populate these data to appropriate select tags through Template7. I tried with data attribute which not working. And once all dropdown’s data loaded then how DOM know that all ajax requests were completed to file the form

Please help to achieve this to succeed in my first app using Framework7 v2

<template>
	<form id="testForm">
		<select id="select1" name="select1">
			{{#each list1 }}
				<option value="{{ this.itemValue }}">{{this.itemText}}</option>
			{{/each}}
		</select>
		<select id="select2" name="select2">
			{{#each list2 }}
				<option value="{{ this.itemValue }}">{{this.itemText}}</option>
			{{/each}}
		</select>
	</form>
</template>
<script>
  return {
	on: {
		pageInit: function() {
			/*First DropDown data Ajax call*/
			app.request({
				.
				.
				.
				success: function(data, status, xhr) {
						/*list1 is available*/
					list1=data;
				}
			});
			/*Second DropDown data Ajax call*/
			app.request({
				.
				.
				.
				success: function(data, status, xhr) {
						/*list12 is available*/
					list2=data;
				}
			});
			
			/*Form fill data Ajax call*/
			app.request({
				.
				.
				.
				success: function(data, status, xhr) {
					/*Form Values*/
					responseData={"select1":"val1", select1":"val2"}
					app.form.fillFromData("#testForm", responseData);
				}
			});
		}
	}
  }
</script>

While F7 has no data binding and/or reactive rendering you have to do these things in your code selfyou.
Use template7 rendering in ajax callbacks then insert resulting html code (with select) your into form.

Hi @adasoft , Thanks for your response.

Can you share sample code for async ajax app.request method to load response data in select tag through template7?

Please help to achieve this in Framework7 v2.
@nolimits4web i need your help on this :roll_eyes:

Look this solution

Hi @adasoft ,

As you mentioned i can do this through javascript on pageInit.

But i need to know is there any option to do this through Templetae7 using data attribute in Framework7 v2 ?