Reputation: 2453
Below is my code and getting warnings as "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'},
]
};
Upvotes: 4
Views: 1735
Reputation: 3012
That warning has been removed as of RC22. It simply indicates that the Grid can't tell what the data type of your column is based on the first row, so it's defaulting to type "string".
You can set a specific type by using the "type" property in your column defs. The main concern for knowing column types is for properly sorting data. You can read about that here: http://ui-grid.info/docs/#/tutorial/102_sorting
Upvotes: 5