I want to make a search filter wherein I wanted to search for the status of an item. The status from my DB are int so I made and equivalence of each index.
To explain more, Here is my codes.
MVC Controller
public JsonResult GetStatusList()
{
return Json(new string[] {
""
,"New"
,"Processing"
,"PR Approved"
,"Qouting"
,"Qouting Approved"
,"PO Processing"
,"Closed"
,"Cancelled"
,"Rejected"
,"PO Issued"
,"On Delivery"
,"Received"
,"AP Posting"
,"Payment"
,"Sourcing"
,"Re-Processing"
},JsonRequestBehavior.AllowGet);
}
Here's my MVC View
<tr data-ng-repeat="model in models | orderBy: sorting:reverse | filter : filter ">
<td>{{jsonDatetotext(model.RequestDate) | date:'MM/dd/yyyy'}}</td>
<td>
<a href="#" data-toggle="modal" data-target="#basicModalContent" data-ng-click="getSelectedPR(model)">{{model.RequestID}}
</a>
</td>
<td>{{model.PARNumber }}</td>
<td>{{model.ProgramName }}</td>
<td>{{model.FullName }}</td>
<td>{{model.DepartmentName | uppercase}}</td>
<td>{{model.PONo}}</td>
**<td>{{StatusList[model.StatusID] | uppercase}}</td>**
<td class="totalAmount"><span class="pull-right">{{model.TotalAmount | number:2}}</span>
</td>
<td>{{model.InboxLearUID | lowercase}}</td>
</tr>
where I wanted to include the status for search filters. The status can only be search by its ID.
Here is my angular
scope.getStatus = http.get('GetStatusList').success(function (status) {
scope.StatusList = status;
});
I wanted the status itself will be searched not just its ID.