Click here to Skip to main content
15,901,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using MVC 5.0, AngularJs and Entityframework. I am using ng-grid and that is displaying all the data as required and given below

OID ONAME DES DDATE IDATE OSTATUS OItemID

1666 Seeta test 26 June 2014, 27 June 2014 22 June 2014 NEW 4


I want to make search on each filed on this grid. Please help me to correct code for this in AngularJS. I am able to search on OID using AngularJs filters however same concept is not working for another fields. Please see the below code which I am using to create api URL.

C#
var apiUrl = '/api/SearchSvc?';

            if ($scope.Search.OID.length > 0) {
                apiUrl += "$filter=substringof('" + $scope.Search.OID + "', OID) ";
            }


            if ($scope.Search.ONAME.length > 0) {

                apiUrl += "and substringof('" + $scope.Search.ONAME + "', ONAME) ";
            }

            if ($scope.Search.DES.length > 0) {
                apiUrl += "and substringof('" + $scope.Search.DES + "', DES) ";
            }


Above grid I am displaying  search form which is having all the textboxes dropdown and calender control in csthml page for above given fields.

Please advice how to use filter for Integer type as well as Date type.

Thanks & Regards,
Care Career
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900