jquery - Properly formatting a table using Angular's ng-repeat -
jquery - Properly formatting a table using Angular's ng-repeat -
i'm working in angularjs environment.
i have next table of chart images i'm converting ng-repeat.
i've managed assign records want display using gadgeticonsctrl below. need display 2 <td> elements per row.
how display 2 <td> elements per row using ng-repeat ?
class="snippet-code-html lang-html prettyprint-override"><table id="gadgets" class="propertytable clickable_row"> <tr> <th>type</th> </tr> <tr> <td data-url="chart_treelist"> <img data-draggable id="chart_treelist" src="images2/table.png" title="tree grid" alt="hierarchy grid" width="64" height="64">grid </td> <td data-url="{chart_pivot}"> <img data-draggable id="chart_pivot" src="images2/pivottable.png" title="pivot table" alt="pivot table" width="64" height="64">pivot </td> </tr> </table>
when user launches modal window in table embedded,so need highlight specific <td> element.
here's illustration of few $scope.widgets chart properties:
$scope.widgets[0].title = "bar chart" $scope.widgets[0].gadgettype = "chart" $scope.widgets[0].charttype = "bar" far i'm working ng-repeat, having problem appying filter
here's ng-repeat , controller attached it:
class="snippet-code-js lang-js prettyprint-override">(function () { 'use strict'; angular.module('rage') .controller('gadgeticonsctrl', ['$rootscope', '$scope', icons]); function icons($rootscope, $scope) { var gadicons = this; gadicons.widgetsubset = null; if ($scope.widget.gadgettype == 'chart' && $scope.widget.charttype == 'bar') { gadicons.widgetsubset = _.filter($scope.widgetdefs, function (item) { homecoming item.charttype == 'bar' || item.charttype == 'column'; }); } }; // end of gridsettings() })(); class="snippet-code-html lang-html prettyprint-override"> <table ng-controller="gadgeticonsctrl gadicons"> <tr ng-repeat="widget in gadicons.widgetsubset" ng-class="" > <td> <img data-draggable ng-src="{{widget.initimage}}" title="{{widget.title}}" alt="hierarchy grid" width="64" height="64">{{widget.title}} </td> </tr> </table>
your advice appreciated.
regards, bob
sorry gave wrong reply before. so, want alter filter type depending on scope. here working rudimentary fiddle should help abstract answer. if want more angular help, if you're interested, shoot me email on site , i'd love talk more angular.
working fiddle https://jsfiddle.net/e6amz/26/
<div ng-repeat"thing in things | filter:mythings"></div> jquery angularjs css3
Comments
Post a Comment