select a column and filter values with select2 angularjs

286 views
Skip to first unread message

leo

unread,
Sep 30, 2014, 3:15:31 PM9/30/14
to ang...@googlegroups.com
i am very new to angularjs. now i have a data table and a filter. in the filter, i have 2 select:column and value. pick a column and filter with the value. my idea is as following:
<tr ng-repeat="f in filters">
       
<td>
         
<select ng-model="f.column"
                 
ui-select2
                 
placeholder="Column"
                 
class="form-control input-sm"
                 
ng-change="filterChange()">
           
<option ng-repeat="c in params.columns" value="{{c}}">{{elementMap[c].label}}</option>
         
</select>
       
</td>
       
<td>
       
<select class="form-control input-sm"
                 
ui-select2
                 
ng-model="f.value"
                 
ng-change="filterChange()">
           
<option ng-repeat="row in data.results" value="{{row.(f.column)}}">{{row.(f.column)}}</option>
       
</select>
       
</td>
</tr>

f.column is binded to the column name i pick up. i need something like {{row.(f.column)}} which angularjs doesn't recognize. is there any way to work around it?

thanks

dinesh kumar

unread,
Oct 8, 2014, 12:07:14 AM10/8/14
to ang...@googlegroups.com
hi,

Replace {{row.(f.column)}} with this {{row[f.column]}}

Thanks

Regards
Dinesh kumar.L

Renhai Zhou

unread,
Oct 8, 2014, 2:40:23 PM10/8/14
to ang...@googlegroups.com
thank you so much, that solve my problem

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/bCEd0ujvnZo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages