I'm using select and angularJs, my selectize is set up like this :
no controller
//configurando o select mrdicamento
$scope.selectize_medicamento = {
plugins: {
'remove_button': {
label: ''
}
},
maxItems: 1,
valueField: 't0051_id_medicamento',
labelField: 't0051_nome',
searchField: 't0051_alldata',
placeholder: "Medicamanto",
create: false,
};
$scope.objMedicamento = { "selectedMedicamento ": null };
$scope.selectedMedicamento = [];
$scope.itemsMedicamento = [];
na view
<div class="uk-width-medium-1-1">
<label>Fornecedor</label>
<selectize id="selectize_medicamento" required config="selectize_mediacmento" options="itemsMedicamento" position="bottom" ng-model="objMedicamento.selectedMedicamento"></selectize>
to get the valueField:
var id_med = $scope.objMedicamento.selectedMedicamento;
But I need to get the labelFiel, that is, the text that is in the seclect, but I could not figure out how, how could I frazer it?
I've tried:
var xx = document.getElementById('selectize_fornecedor').value;
But it does not work