我的每一列都是复杂的类型。
使用自定义格式,我希望能够显示一个属性的文本,然后根据另一个属性为单元格着色(或真正做任何事情)。
例如:
public class MyRowObject
{
public MyCellObject Cell1 { get; set; }
public MyCellObject Cell2 { get; set; }
public SomeOtherCellObject Cell3 { get; set; }
}
public class MyCellObject
{
public string MyDisplayText { get; set; }
public int MyNumber { get; set; }
}
然后使用自定义格式化程序 javascript 函数来做一些事情,例如:
function formatCourseData(cellValue, options, rowObject) {
var linkHTML = cellValue.MyDisplayText;
if (cellValue.MyNumber > 10) {
//format the html in some way
}
return linkHTML;
}
现在我知道我不能做 cellValue.MyDisplayText 但这个或类似的事情是我想要做的。
这可能吗?
它在任何地方都有记录吗?(我看过,但找不到任何东西)。
提前致谢。