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
Ayesha Fathima
NA
184
29.8k
Refresh Data table with new data set
Feb 6 2018 11:32 PM
Hi, i am initiating data table on onclick of table column values,there iam calling one service from that service output iam forming data set and setting it to data table.
If u click on one column value for the first time it is showing some data related to that row,But after that iam clicking on another row in that column only it is showing previous data set.Data table is not getting refreshed with fresh data.Iam using function to refresh data table,but it is not working.If iam not putting this line "retrieve: true," it is showing error like cannot reinitialize data table.
How can i refresh with new data set values??
$(
'#attachmenttable'
).DataTable( {
retrieve:
true
,
//need to write this line otherwise it wil throw an error like "cannot reinitialize data table"
paging:
false
,
searching:
false
,
data: combinedarray,
columns: [
{ title:
"File Name"
,visible:
true
,
"render"
:
function
( data, type, row ) {
return
'<a href="javascript:void(0)" onclick="opendetails('
+"
'"+row[1]+"'
"+"
,
'"+row[0]+"'
"+')"
>' + data +
'</a>'
;
}},
{ title:
"Base64"
,visible:
false
}
]
} );
function
refreshTable() {
$(
'#dataTables-attachmenttable'
).DataTable({
responsive:
true
,
"paging"
:
false
,
"info"
:
false
,
"searching"
:
false
,
"order"
: [[ 1,
"desc"
]]
});}
setInterval(refreshTable , 1000 );
Reply
Answers (
1
)
Get second Column value,When user clicks on First column Val
Give hyperlink on image column in data table