angularjs - angular ui grid date filter to search the date in column -
i wanted search date in search column, using angular ui date filter.
when try search date in column, not showing correct date. want show exact match of user search. example: if user types 22-aug-16, should show date matching date, suppose if users types 25-aug alone should show dates matching 25th august in year present in database.
i tried code like,
.controller( 'blockadetailscontroller', [ '$scope', '$rootscope','$location','$routeparams', '$filter', 'commonservice', 'blockadetailsservice', '$q', function($scope, $rootscope,$location, $routeparams, $filter, commonservice, blockadetailsservice, $q) { $scope.changeactorgridoptions = { enablefiltering : true, columndefs : [ { { name : 'lldate', field : 'lldate', displayname : 'last_login', width : '100', minwidth: '90', celltemplate : '<div title="{{col_field | date:\'dd-mmm-yy\' }}">{{col_field | date:"dd-mmm-yy" }}</div>', headertooltip : true, cellclass : function(grid, row, col, rowrenderindex, colrenderindex) { return 'gridgroupcell'; }, headercellfilter : 'translate', },
here tried
type: 'date'
and added onselect function mentioned in same kind of question in stackoverflow.
like,
onselect: function(date){ scope.$apply(function() { ngmodel.$setviewvalue(date); }); }
please me in this, hope explained requirement. kindly show assistance it.
this column field doing search,
this worked me,
{ name : 'lldate', field : 'lldate', displayname : 'last_login', type : 'date', cellfilter : 'date:"dd-mmm-yy"', filtercellfiltered : 'true', width : '100', minwidth: '90', celltemplate : '<div title="{{col_field | date:\'dd-mmm-yy\' }}">{{col_field | date:"dd-mmm-yy" }}</div>', headertooltip : true, cellclass : function(grid, row, col, rowrenderindex, colrenderindex) { return 'gridgroupcell'; }, headercellfilter : 'translate', },
Comments
Post a Comment