我正在尝试在 HTML 表中实现剑道进度条。因此,到目前为止,我能够在表格单元格内呈现进度条,但无法将其绑定到名为“百分比”的模型属性。我在值字段中使用 item.Percentage 但无法将其绑定到进度条以根据百分比值更改显示。
Relevant part of the HTML table cell:
<td align="center">
@*<div id="profileCompleteness"></div>*@
<div class='progress'></div>
@Html.DisplayFor(modelItem => item.Percentage)
</td>
Javascript:
<script>
$(".progress").each(function(){
var row = $(this).closest("tr");
var model = grid.dataItem(row);
$(this).kendoProgressBar({
value: item.Percentage,
min:0,
max: 1100,
type:"chunk"
});
});
</script>
Model
public class MainScreenViewModel
{
private IMainScreenRepository mainScreenRepository;
#region Properties
[Required]
public decimal ReportId { get; set; }
public string ReportDescription { get; set; }
public string Status { get; set; }
public string Percentage { get; set; }
}
请指出我正确的方向。我不知道如何将百分比值属性绑定到 Progressbar 以动态显示该值。