Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date filter is ignored
Message
 
 
À
28/05/2015 01:54:25
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01620266
Message ID:
01620284
Vues:
42
I got it working. The problem was that the transactionDate was also bound to another control (in a directive) at that same form. The newTransact object has another dateTime column which is the same as transactionDate (in fact, the transactionDate is created to feed that directive). So, I just used that dateTime column at the top and now it displays correct info.

Tricky!

I have a bit unrelated question.

I have the following code:
  <table  id="transactionsList" ng-show="invoiceTransactionsObject.transactions.length>0"
                       class="table table-bordered table-hover table-list">
                    <thead>
                        <tr>
                            <td>Trans No</td>
                            <td>@Labels.quantity</td>
                            <td>@Labels.message</td>
                            <td>@Labels.item</td>
                            <td>@Labels.amount</td>
                            <td>@Labels.CreatedBy</td>
                            <td>@Labels.CreatedOn</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="trans in invoiceTransactionsObject.transactions | filter:searchTerm">
                            <td>{{trans.transNo}}</td>
                            <td>{{trans.quantity}}</td>
                            <td>{{trans.message}}</td>
                            <td>{{trans.item}}</td>
                            <td><span ng-class="{'negative-amount' : trans.extension < 0}">{{trans.extension | currency}}</span></td>
                            <td>{{trans.operator}}</td>
                            <td>{{trans.dateTime | date: 'MM-dd-yyyy'}}</td>
                        </tr>
                    </tbody>
Note the filter in ng-repeat directive. The problem is that I also have 2 date controls on that form
<div class="row">
            <div class="col-md-4 col-md-offset-1">
                <data-sm:date-time-picker ng-model="startDate" pick-time="true"
                                          is-date-range="true" form="form" data-no:dirty-check="true"
                                          compare-date="endDate" name="startDate"></data-sm:date-time-picker>
            </div>
            <div class="col-md-4 col-md-offset-0">
                <data-sm:date-time-picker ng-model="endDate" pick-time="true"
                                          is-date-range="true" form="form"
                                          compare-date="startDate" data-no:dirty-check="true"
                                          is-end-date="true"
                                          name="endDate"></data-sm:date-time-picker>
            </div>
            <button class="col-md-3 btn" ng-click="filterByDate()">@Labels.filter</button>
        </div>
So, if these dates (or one of them) are populated, I want to also apply the dates filter. I found http://stackoverflow.com/questions/25515431/ng-repeat-filtering-data-by-date-range so I plan to create a custom dateRange filter (need to somehow make it more generic to allow to pass date column name), but I am wondering how can I combine 2 filters?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform