jquery bootstrap selectpicker refreshing lists based upon previous list choice

前端 未结 5 1998
甜味超标
甜味超标 2020-12-28 12:38

I have three drop down lists, one list is populated on page load and doesn\'t change. The 2nd and 3rd lists may change depending on the selection. This functionality is wo

5条回答
  •  误落风尘
    2020-12-28 13:37

    In my Ajax successCallBack I am trying to manipulate drop down list having id as reasonCode based on dynamicId (value get from server) as below:

    $('#reasonCode option[value='+dynamicId+']').prop('selected', true);
    

    but unfortunately this had not worked until I added another line after this as below:

    $('#reasonCode').selectpicker('refresh');
    

提交回复
热议问题