ui-grid datepicker未设置角度js中的值

时间:2016-09-13 17:04:23

标签: angularjs datepicker angular-ui-grid

{
    "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
    };

1 个答案:

答案 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中的对象可能存在问题。