我有一个网格数据,我向他推送新数据。新数据必须包含至少一个不同的值。
我试过这个:
vm.checkUnique = function () {
var gridData = vm.sanctionReferencesGridOptions.data;
var formData = vm.editableGrid.newRowForm;
for (var i = 0; i < gridData.length; i++) {
var rowData = gridData[i]
for (var key in rowData) {
console.log('rowData: ' + key);
for (var formKey in formData) {
console.log('formKey: ' + formKey);
}
}
}
}
vm.sanctionReferencesGridOptions.data = [
{
"code": 1111,
"listName": "List 1",
"sinceDate": "2017-08-23",
"endDate": "2017-08-23"
}, {
"code": 2222,
"listName": "List 2",
"sinceDate": "2017-08-23",
"endDate": "2017-08-23"
}
]
vm.editableGrid.newRowForm = {
code: "1111",
listName: "List 1",
sinceDate: "2017-08-23",
endDate: "2017-08-23"
}
因此,在此示例中,我必须显示包含重复行数据的错误消息..
感谢您的帮助!