Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am using AngularJS in a SharePoint 2013 App but I don't think SharePoint here will influence the response (I could be wrong there, though).

I have a custom list of about 350 requests each with a RequestType from a list of (Development,Design,EmailCampaign,AdWords) and a title (any other info is immaterial).

On the Landing Page of the App, I am presenting 4 tables (one for each RequestType) so that it is easier for the person responsible to see their queue. I am also adding an input of text to each table to filter the results by the title so the user can find a task quickly.

I can get either filter to work independent of the other but I have no idea how to implement them together. Can this be done? If so, how?

Sample Data:

{ title: Easter Sale Campaign, RequestType: EmailCampaign},
{ title: Easter Sale Microsite Prototype, RequestType: Design},
{ title: Easter Sale Microsite Sprites, RequestType: Design},
{ title: Easter Sale AdWords Analytics, RequestType: AdWords},
{ title: Easter Sale Microsite Build, RequestType: Development},
{ title: Easter Sale Microsite Test, RequestType: Development},
{ title: Easter Sale PromoteToProduction, RequestType: Development},
{ title: Spring Sale Campaign, RequestType: EmailCampaign},
{ title: Spring Sale Microsite Prototype, RequestType: Design},
{ title: Spring Sale Microsite Sprites, RequestType: Design},
{ title: Spring Sale AdWords Analytics, RequestType: AdWords},
{ title: Spring Sale Microsite Build, RequestType: Development},
{ title: Spring Sale Microsite Test, RequestType: Development},
{ title: Spring Sale PromoteToProduction, RequestType: Development}

HTML

<div id="landing_header_bar" data-tbl="tblDesign" class="clr-blue">
    <img alt="Close This" class="btnToggleLanding" src="../Images/close_btn.png" ng-click="taskClose = true" ng-hide="taskClose" />
    <img alt="Open This" class="btnToggleLanding" src="../Images/open_btn.png" ng-click="taskClose = false" ng-show="taskClose" />
    <h3 class="divider_title inlined">Design Requests</h3>
    <span class="filterQueue">
        Filter:&nbsp;<input type="text" ng-model="taskFilter" />
    </span>
</div>
<table class="tblLanding">
    <tr class="landing_header_row">
        <th ng-click="doTasksSort('Priority')">Priority</th>
        <th ng-click="doTasksSort('Task_Id')">ID</th>
        <th ng-click="doTasksSort('Description')">Title</th>
        <th ng-click="doTasksSort('RequestType')">Task Type</th>
    </tr>
    <tbody>
        <tr class="landing_data_row" ng-repeat="req in requests | filter:request.requestType="Design" | orderBy:sortTasksBy:!reverse">
            <td style="text-align:center;">
                <img ng-src="../Images/{{req.Priority}}.jpg" />
            </td>
            <td style="text-align:center;">{{req.Task_Id}}</td>
            <td><a href="#">{{req.title}}</a></td>
            <td>{{req.requestType'}}</td>
        </tr>
        <tr ng-show="requests.length == 0"><td colspan="8" align="center"><strong>No Requests Found!</strong></td></tr>
    </tbody>
</table>
share|improve this question
up vote 2 down vote accepted

You are breaking the filter chain by using double quotes around "Design".

You should use it like this:

<tr class="landing_data_row" ng-repeat="req in requests | filter:request.requestType='Design' | orderBy:sortTasksBy:!reverse">

or

<tr class="landing_data_row" ng-repeat='req in requests | filter:request.requestType="Design" | orderBy:sortTasksBy:!reverse'>

share|improve this answer
    
that fixed the initial filter to fill the boxes...Thanks! Now, how do I wire up the type filter to allow the user to search within the already filtered results to find the request they are seeking? – jgravois Apr 13 '14 at 17:10
    
@jgravois you mean filter over the search term 'taskFilter' ? – goutham Apr 13 '14 at 17:14
    
yes, I want the contents of each table to be filtered again by whatever is entered in the input – jgravois Apr 13 '14 at 17:24
    
you can pipe the search filter as the third one like ` '| filter: taskFilter' ` – goutham Apr 13 '14 at 17:33
    
thanks, again ... I didn't know you could have 2 filter objects – jgravois Apr 13 '14 at 17:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.