반복 입력을받는 객체의 특정 속성을 기반으로 검색해야하는 검색 입력란을 구현 중이며 라디오 버튼을 사용하여 선택하려고합니다. 당신이 볼 수 있듯이라디오 선택을 기준으로 AngularJS 필터
<span style="margin-bottom: 10px; display: inline-block;">Search: <input ng-model="searchText.CustomerName" /> </span>
<table id="Table1" class="alertTable">
<thead>
<tr>
<th class="xsmCol"><img src="/App_Themes/SkyKick/images/misc/clear.gif" class="iFlag" /></th>
<th>Subject</th>
<th>Customer</th>
<th>Type</th>
<th>Date</th>
<th class="smCol">Actions</th>
</tr>
</thead>
<tbody id="tbAlerts">
<tr ng-repeat-start="alert in alerts | filter:searchText" > <!-- | filter:searchText -->
<td><img src="/App_Themes/SkyKick/images/misc/clear.gif" data-tooltip="{{ alert.tooltip }}" class="{{ 'iAlert' + alert.AlertType }}"/></td>
<td><a href="Show Alert Details" ng-click="showAlertDetails($event)">{{ alert.Summary }}</a></td>
<td>{{ alert.CustomerName }}</td>
<td>{{ alert.CreatedDate }}</td>
<td>{{ alert.Category }}</td>
<td>
<!-- Tricky little widget logic -->
</td>
</tr>
<tr ng-repeat-end class="alertDetail">
<td></td>
<td colspan="5" ng-bind-html="alert.Details"></td>
</tr>
</tbody>
</table>
, 나는 현재 나의 배열의 CUSTOMERNAME 필드의 기반으로 필터링하고 있습니다 : 예를 들어
여기 내 코드입니다. 그러나 나는 CustomerName, Subject, Type 및 Date 중에서 라디오 단추를 사용하여 선택할 수 있도록 논리를 변경하려고합니다. 따라서 사용자가 Date 라디오 버튼을 클릭하면 searchText는 Date 속성을 기반으로 만 필터링합니다. 이 기능을 사용하는 가장 좋은 방법은 무엇입니까?
. 대단히 감사합니다. –