0
我正在使用Gijgo網格來管理表格的數據。如何在Gijgo Grid中設置不同的背景色到行?
我會設置不同行的背景顏色。顏色在模型中。
查看
grid = $("#grid").grid({
dataSource: { url: '@Url.Action("Method", "MyController")', success: onSuccessFunc },
dataKey: "Id",
uiLibrary: "bootstrap",
columns:
[
{ field: "Id", sortable: false, hidden: true },
{ field: "Name", sortable: false, hidden: true },
{ field: "Description", title: "Tipologia", sortable: false, width: "70%" },
{ field: "Value1", title: "Value 1", align: 'center', sortable: false },
{ field: "Value2", title: "Value 2", align: 'center', sortable: false },
{ field: "Edit", title: "", width: 34, type: "icon", icon: "glyphicon-pencil", tooltip: "Edit", events: { "click": Edit } }
]
});
視圖模型
public class ViewModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public double? Value1 { get; set; }
public double? Value2 { get; set; }
public string Group { get; set; }
public string BackGroudColor { get; set; }
}
我該怎麼做才能綁定網格的行的屬性的backgroundColor到BACKGROUNDCOLOR模型的財產?
非常感謝。
查爾斯
大阿塔納斯...謝謝您 – Charles