javascript - ng-grid and custom directives with images -
javascript - ng-grid and custom directives with images -
we having pretty major issues ng-grid , directives.
basically have ng-grid, , have directive supplies image.
what have done:-
created simple directive displays image issue :- on scrolling image tended jump , downwards onto different rows
after much googling, discovered should utilize $watch statement, our directive looks :-
.
mylists.directive('status', function () { homecoming { restrict: 'e', replace: true, template: '<div ng-switch="alert">' + '<div ng-switch-when=""></div>' + '<div ng-switch-default><img src="{{alert}}.ictrl" /></div>' + '</div>', scope: { alertdata: '=alertdata' }, link: function (scope, element, attrs) { function updateicalert(stralert) { scope.alert = ""; if ((stralert !== null) && (stralert !== undefined) && (stralert !== '')) { scope.alert = stralert; } homecoming scope.alert; } //function scope.$watch('alertdata', function (oldvalue, newvalue) { if (newvalue) { updateicalert(scope.alertdata); } }); } } });
this @ to the lowest degree stops image jumping rows, however, new issue :-
the grid running slow, , clicking on column header (for ordering) duplicating data..
are missing this?
javascript angularjs angularjs-directive ng-grid
Comments
Post a Comment