{
"firstName": "Cox",
"lastName": "Carney",
"company": "Enormo",
"test":{ "date": "10/14/2015 02:45:33 AM"}
}
如果我将日期绑定到ui-grid datepicker
并更改它未在网格中反映的行的datepicker
值。
$scope.gridOptions = {
enableGridMenu: true,
data: 'data',
columnDefs: [
{ name: 'First Name', field: 'firstName' },
{ name: 'Last Name', field: 'lastName'},
{ name: 'Company', field: 'company' },
{ name: 'Date',
field: 'test.date',
cellFilter: 'textDate:"M/d/yyyy"',
editableCellTemplate: '<div><form name="inputForm"><div ui-grid-edit-datepicker ng-class="\'colt\' + col.uid"></div></form></div>'
}
],
enableCellEditOnFocus: true
};
答案 0 :(得分:0)
{
"firstName": "Cox",
"lastName": "Carney",
"company": "Enormo",
"test":"10/14/2015 02:45:33 AM"
}
像这样,然后在columnDefs:
{
name: 'Date',
field: 'test',
cellFilter: 'textDate:"M/d/yyyy"',
editableCellTemplate: '<div><form name="inputForm"><div ui-grid-edit-datepicker ng-class="\'colt\' + col.uid"></div></form></div>'
}
datepicker
中的对象可能存在问题。