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
Murali krishna Ande
NA
57
51.5k
Bind both the table inside the Div using Knockoutjs
Jan 16 2014 8:54 AM
Hi,
I have a requirement to show the employees department wise like below;
Department: Developers Count:3
EmpID
Name
Salary
Action
101
AAAAA
10000
some buttons
102
BBBBB
15000
103
CCCCC
10000
Department:Finance Count:2
EmpID
Name
Salary
Action
104
xxxxx
10000
some buttons
105
yyyyyy
15000
For the above requirement I designed my View like below
<div data-bind="foreach: Departments">
<span class="pull-left" data-bind="text: DeptName"></span>
<span class="pull-right" data-bind="text: Count"></span>
<table>
<thead>
<tr>
<th>EmpID</th>
<th>Name</th>
<th>Salary</th>
<th>Action</th>
</tr>
</thead>
<tbody data-bind="foreach: Employees">
<tr>
<td>
<span data-bind="text: EmpID"></span>
</td>
<td>
<span data-bind="text: Name"></span>
</td>
<td>
<span data-bind="text: Salary"></span>
</td>
<td>
<button type="submit" value="View"></button>
</td>
</tr>
</tbody>
</table>
</div>
Can somebody help with the knockout code. How to bind the data to Div and Table inside in it.
Thanks in Advance
Murali Krishna.
Reply
Answers (
4
)
Difference between Client and Server side Java Script
add tolltip in html page