I am working with Dart and JQuery. In the view I try to use select2 for a ComboBox component,my code is:
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">Select</label>
<div class="col-md-9 col-sm-9 col-xs-12">
<select class="select_cities form-control" tabindex="-1">
<option value="NY">New York</option>
<option value="LA">Los Angeles</option>
<option value="CH">Chicago</option>
<option value="HO">Houston</option>
<option value="PH">Phoenix</option>
</select>
</div>
</div>
...
<script>
$(document).ready(function () {
$(".select_cities").select2({
placeholder: "Select a City",
allowClear: true
});
});
</script>
My question is, how can I call this function in Dart? because when the view is loaded the select_cities component doesn't work, I suppose that every jquery function has to be called in Dart file.
Thanks for all