Forum Post: Re: Picklist Values In Jsdo Coming As Numeric Values

  • Thread starter Thread starter Ganesh Cherivirala
  • Start date Start date
Status
Not open for further replies.
G

Ganesh Cherivirala

Guest
Hi, There is no direct way to get the picklist values. However there is an API to return the data. Below is the sample code to get the picklist, where the state is the picklist. picklist gives the response as array with code, ID, Name e.g: as below code: "AL" id: 98892459 name: "Alabama" var pickListStateResponse = jsdo.getPicklist_state(); if(pickListStateResponse.response.picklistData){ var stateList = pickListStateResponse.response.picklistData; var stateEle = $('#state'); for(var k=0;k '+stateList[k].name+' ')); } //console.log(selectedRow); if(selectedRow && selectedRow.state){ for(var l=0;l<stateList.length;l++){ if(stateList[l].id===selectedRow.state){ stateEle.val(stateList[l].id); break; } } } } Hope if helps!. Regards, Ganesh

Continue reading...
 
Status
Not open for further replies.
Back
Top