Note that there are some explanatory texts on larger screens.

plurals
  1. POusing success event ofjquery / ajax to fill and set dropdownlist value
    primarykey
    data
    text
    <p>i have a Ajax request to Fill an edit form like..</p> <pre><code>function FillLiveDetail(event, LiveID) { $.ajax ({ type: "POST", url: MyUrl + '/GetLiveDetail', data: '{LiveID: "' + LiveID + '"}', contentType: "application/json; charset=utf-8", dataType: "json", success: function(data) { var LiveDetail = data.d; $('#ClassName').val(LiveDetail[0].Title); $('#ClassDesc').val(LiveDetail[0].Desc); $('#SearchKey').val(LiveDetail[0].Keys); $('#Date').val(LiveDetail[0].Date); $('#Hour').val(LiveDetail[0].Hours); $('#Minute').val(LiveDetail[0].Minuts); $('#AM_PM').val(LiveDetail[0].AmPm); $('#Duration').val(LiveDetail[0].Duration); $('#rdbLivePrivacy).prop('checked',true); CategoryList(event, 'MyddlCategory'); $('#MyddlCategory').val(LiveDetail[0].CategoryID); } }); } function CategoryList(event, ddl_Category_ID) { var ddl_Category = $('#'+ddl_Category_ID); event = event || window.event || e.srcElement; event.preventDefault(); $.ajax ({ type: "POST", url: ServiceUrl +'/FillAllCategories', contentType: "application/json; charset=utf-8", dataType: "json", success: function(data) { var MyCategoryList = data.d; $(ddl_Category).html('&lt;option value="0" selected="selected"&gt;All Category&lt;/option&gt;'); for(var m=0; m&lt;MyCategoryList.length; m++) { var row = ['&lt;option value="'+MyCategoryList[m].CategoryID+'"&gt;'+MyCategoryList[m].CategoryName+'&lt;/option&gt;'].join('\n'); $(ddl_Category).append(row); } } }); } </code></pre> <p>My problem is, I can not change the definition of my function <code>CategoryList()</code> because i used it at many places in my project...<br> In this context the success: event of <code>CategoryList()</code> function Fire when success: event of <code>FillLiveDetail()</code> function completes that is why i am unable to set the value of <code>MyddlCategory</code>...<br> please suggest me any thing that may work..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload