0

i have used this documentation smart table

<form>
    <label for="predicate">selected predicate:</label>
    <select class="form-control" id="predicate" ng-model="selectedPredicate" ng-options="predicate for predicate in predicates"></select>
</form>
<table st-table="rowCollection" class="table table-striped">
    <thead>
    <tr>
        <th st-sort="firstName">first name</th>
        <th st-sort="lastName">last name</th>
        <th st-sort="birthDate">birth date</th>
        <th st-sort="balance">balance</th>
        <th>email</th>
    </tr>
    <tr>
        <th>
            <input st-search="{{firstName}},{{lastName}}" placeholder="search for firstname" class="input-sm form-control" type="search"/>
        </th>
        <th colspan="3">
            <input st-search placeholder="global search" class="input-sm form-control" type="search"/>
        </th>
        <th>
            <input st-search="{{selectedPredicate}}" placeholder="bound predicate" class="input-sm form-control" type="search"/>
        </th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="row in rowCollection">
        <td>{{row.firstName | uppercase}}</td>
        <td>{{row.lastName}}</td>
        <td>{{row.birthDate | date}}</td>
        <td>{{row.balance | currency}}</td>
        <td><a ng-href="mailto:{{row.email}}">email</a></td>
    </tr>
    </tbody>
</table>

i have used st-search search for particular column . it is working fine but two column not working. can you help me? i need search two column only

Angu
  • 862
  • 2
  • 13
  • 32

2 Answers2

0

There is apparently no way to achieve this directly with the built smart-table.

You can use a directive like suggested here : AngularJS smart-table search within multiple columns

Community
  • 1
  • 1
Ellone
  • 3,644
  • 12
  • 40
  • 72
0

I have another idea for others who have the same problem: If your data rowCollection is not too big, in the javascript in the init() of the page do something like:

self.rowCollection.forEach(function (element) {

  element.NameForFilter = element.firstName+ ' ' + element.lastName;  
});

and then in the input of the th:

st-search=NameForFilter
Nithin Kumar Biliya
  • 2,763
  • 3
  • 34
  • 54
talia
  • 1