Hello,
I'm using the code below to retrieve data from a SP list and display it on a dropdown field. How do I make it so that after the values are retrieved from SP, the first value display on the dropdown (index 0)? I tried the code fd.field('DropDown1').widget.select(0); but it is not working. It works on a regular dropdown but not on a dropdown whose value are retrieved from SP.
Also, how can I change it so that if no value is found, it displays a particular text instead of "No Data Found". I need to be able to differentiate if the result is blank or not and act accordingly.
fd.rendered(function() {
fd.field('DropDown1').widget.setOptions({dataTextField : 'text', dataValueField: 'value'});
var widget3 = fd.field('DropDown1').widget;
widget3.text('');
widget3.setDataSource({
transport: {
read: 'YYYYYYYYY==&info=5523EI39',
// success: alert('hi')
}
});
widget3.setOptions({dataTextField: 'fields.Title', dataValueField: 'fields.Title'});
Validator()
function Validator(){
fd.field('DropDown1').widget.select(0);
}