0
我能够通过模板情节低于剑道下拉列表添加到剑道剑道格下拉列表值/文本/索引:获取选定剑道电网MVVM
<script type="text/x-kendo-template" id="ddlGrid">
<input data-role="dropdownlist"
data-text-field="Text"
data-value-field="Value"
data-bind="source: actionSource, events: { change: onChange}"/>
</script>
<div class="demo-section">
<div class="k-content" style="width: 100%">
<div id="grid"
data-role="grid"
data-sortable="true"
data-selectable="true"
data-columns="[
{ field: 'ProductID' },
{ field: 'ProductName' },
{ field: 'UnitPrice' },
{ field: 'UnitsInStock' },
{ field: 'Discontinued' },
{ title: 'Action', template: kendo.template($('#ddlGrid').html())} ]"
data-bind="source: dataSource, event">
</div>
</div>
然而,问题是如何访问该下拉列表以获取值/文本/索引。 到目前为止,我可以使用这种方法获得所选行的数据:
var onClick = function (event, delegate) {
event.preventDefault();
var grid = $("#grid").data("kendoGrid");
var selectedRow = grid.select();
var dataItem = grid.dataItem(selectedRow);
if (selectedRow.length > 0)
delegate(dataItem);
else
alert("Please select a row.");
};
var viewModel = new kendo.data.ObservableObject({
dataSource: productDatasource,
actionSource: actionDataSource,
onChange: function (event) {
onClick(event, function (dataItem) {
alert(dataItem.ProductID + " " + dataItem.ProductName);
});
},
});
请帮助我,我卡住了。
在此先感谢。
grid.dataItem($(event.sender.wrapper).closest(“tr”));我花了很多时间才到达这里。想要在组合框的SELECT事件上获得select grid grid(这是作为templete单元格)。谢谢 – InTheWorldOfCodingApplications
这是真棒感谢你的人! – saulyasar