我正在使用 Wijmo 网格,并希望获取 wijgrid 内使用的受尊重国家下拉列表的货币值。简单地说,我可以在没有 Wijgrid 的情况下获得相同的功能,但在 Wijgrid 的情况下则不行。所以请做必要的事情,代码如下内联-CSHTML代码:
<td style="border: 1px solid black;">
@Html.DropDownListFor(m => Model[i].IdCountry, new SelectList(Model[i].HCCountry, "Id", "Value"), "-Select-", new { @id = "country", style = "width: 75px;" })
</td>
<td style="border: 1px solid black;">
@Html.TextBoxFor(m => Model[i].txt_Currency, new { @id = "currency", style = "width:50px; border: none;" })
</td>
jQuery代码:
$(function() {
$('#country').change(function () {
// fetch the newly selected value
var selectedValue = $('#country').val();
// send it as an AJAX request to some controller action
$.post('@Url.Action("~/Application/GetCurrencies")', { value: selectedValue }, function (result)
{ $('#currency').html(result); });
});
});
感谢和问候迪帕克