Wednesday 15 September 2010

jquery - Parsing html result in ajax and modifying it -



jquery - Parsing html result in ajax and modifying it -

i trying retrieve html partial view via ajax , assign in jqgrid cell. html (dropdown) retrieved fine within ajax , beingness added within jqgrid cell.

the issue facing trying trying assign new attr value html before placing within jqgrid (am trying add together jqgrid row id later can identified row's dropdown clicked). the code below:

$.ajax({ url: '@url.action("getcouriercompanies", "<controller>")', type: "post", datatype: "html", data: { storeid: storeid }, async: false, success: function (msg) { var ids = $("#grid").jqgrid('getdataids'); (var = 0; < ids.length; i++) { var html = $(msg).html(); $(html).find("select").data("id",ids[i]); jquery("#grid").jqgrid('setrowdata', ids[i], { courier: html }); } }, error: function () { alert("unable retrive courier company list.."); } });

the contents of partial view follows:

<div> <select class="courierdropdown" onchange="getservicelist()"> @foreach (<namespace>couriercompany item in model) { <option value="@item.oid">@item.companyname</option> } </select> </div>

the reason outer div when using .html() , returns innerhtml of response in case (verified) select tag

any assistance appreciated.

jquery ajax jqgrid

No comments:

Post a Comment