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
Tonmoy Saha
NA
37
785
Dynamically bind Id to a Datatable column
Sep 1 2017 5:47 PM
$.ajax({
type: "POST",
url: path,
dataType: "json",
data: { ClientCode: clientCode },
success: function (result) {
var table = $('#finalizeTable').DataTable({
'columnDefs': [
{
'targets': 5,
'createdCell': function (td, cellData, rowData, row, col) {
$(td).attr('data-toggle', 'popover');
$(td).attr('data-trigger', 'hover');
$(td).attr('id', 'OrderId');
}
}
]
});
table.clear().draw();
for (var i = 0; i < result.length; i++) {
var OrderId = result[i].OrderId;
var remove = '
';
var details = 'view Details';
var rowNode = table.row.add([
result[i].OrderId,
result[i].OrderNo,
result[i].ShopName,
result[i].OrderDate,
result[i].Total,
details,
remove,
]);
table.column(0).visible(false);
//table.column(5).addClass(selectdetails);
//table.column(5).attr('id', result[i].OrderId);
var theNode = $('#finalizeTable').dataTable().fnSettings().aoData[rowNode[0]].nTr;
theNode.setAttribute('id', +result[i].OrderId);
}
table.draw();
Can Anyone help me how can i bind orderid to column 5 dynamically for each row.
Reply
Answers (
1
)
Webmethod is not called in asp.net C#
Ajax Calendar Extension