TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prashanth Olekar
NA
35
576
Matched row come first in table how, in Angularjs1?
Feb 3 2018 11:06 AM
Im using Smart table i want to keep matched rows on top of other rows in table using angularjs(1), in my case i have been matching string from table Cell, on the basis of matched string I'm changing row background color,once the row turns to colored row it should disply on top of the other normal rows, so that I'm able see matched rows instantly. how i can achieve this.
my code
<
tbody
>
<
tr
ng-repeat
=
"std in students"
ng-style
=
"set_color(std)"
>
<
td
>
{{std.Name}}
</
td
>
<
td
>
{{std.ClassName}}
</
td
>
<
td
>
{{std.RollNo}}
</
td
>
<
td
>
{{std.Email}}
</
td
>
</
tr
>
</
tbody
>
Controller:
$scope.set_color =
function
(std) {
var
inputString = std.Name;
for
(i = 0; i < inputString.length; i++)
{
var
findme =
"Olekar"
;
if
(inputString.indexOf(findme) > -1)
{
return
{
'background-color'
:
'#FFCCCB'
}
}
}
}
Reply
Answers (
1
)
Angular .service() or .factory(), which one is better
Can i Started learning angular5 without angular 2 ,4 ?