Home > Mobile >  Select select box in the onload load data, can't show in the list
Select select box in the onload load data, can't show in the list

Time:01-27



 
Page ({
Data: {
Options: [{
Id: '001',
RoomDesc: 'Beijing'
},
Selected: {}
},
/* *
* life cycle function - listening page load
*/
OnLoad: function (options) {
Var that=this;
Wx. Request ({
Url: getApp (). GlobalData. Url + 'GetGpRoom',
Data: {},
Header: {
'the content-type' : 'application/x - WWW - form - urlencoded',
'cookies' : wx. GetStorageSync (' CookieKey')
},
Success (res) {
If (res) data) err==false)
{
That the setData ({
Options: JSON. Parse (res) data) MSG)
})
The console. The log (that. Data. The options).
}
}
})
}
})



Initialization code as above, if the data displayed a normal dropdown

But the data to be loaded in the onl oad assigned to option, interface is not loading, according to data
Please grant instruction greatly, small program a small white thanked here
  • Related