I have a ui-grid with a bunch of columns using the built in filtering. One of the columns is "owner". There is a button you can click that says "My Items". When clicked that button should populate the Owner Filter field with the users name and filter the items. I am setting the filter as follows as specified in the ui-grid documentation:
$scope.gridApi.grid.columns[3].filters[0] = "somename";
However "somename" never shows up in the column filter header, and the data never refreshes. I've tried calling refresh() as well as notifyDataChange but nothing seems to work.
Thanks.
Here is the correct way of doing it. By the way, there is no need to call refresh() function.
$scope.gridApi.grid.columns[3].filters[0] = {
term: somename
};