无法从数据分配类型,因此默认为 angular ui-grid 中的字符串

Unable to assign type from data, so defaulting to string in angular ui-grid

下面是我的代码并收到警告 "Unable to assign type from data, so defaulting to string"

vm.usersGrid = {
    enableRowSelection: true,
    multiSelect: true,
    data: "vm.users",
    columnDefs: [
        {field: 'id', visible: false, displayName: 'UserId'},
        {field: 'email', displayName: 'User Name'},
        {field: 'countries', displayName: 'Country'},
        {field: 'status', displayName: 'Status'},
    ]
};

从 RC22 开始,该警告已被删除。它只是表示 Grid 无法根据第一行判断列的数据类型,因此默认输入 "string".

您可以使用列定义中的 "type" 属性 设置特定类型。了解列类型的主要问题是正确排序数据。你可以在这里阅读:http://ui-grid.info/docs/#/tutorial/102_sorting