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.6k
show attachments in html table from servlet url
Feb 3 2018 3:40 AM
Hi ,
I have multiple attachments consist of file name and base64 content for each attachment from servlet URL,how can i set all the attachments in HTML table.After clicking on filename i should open that attachment.
How can i do that by using javascript or jquery only.
Here what i have tried
$.cordys.ajax({
method:
"Getattachmentdetails"
,
namespace:
"http://schemas.cordys.com/IMSPackage"
,
parameters: {
emailid:mailidvalue
},
dataType:
'* json'
,
success:
function
(result) {
output=result;
bodycontent=output[
"data"
][
"body"
];
for
(
var
i=0;i<output[
"data"
][
"tuple"
].length;i++)
{
attname=output[
"data"
][
"tuple"
][i][
"name"
];
base64value=output[
"data"
][
"tuple"
][i][
"base64"
];
}
//$('#mailcontent').show();
//document.getElementById("mailcontent").value = bodycontent;
attachmenttable = $(
'#attachmenttable'
).DataTable({
columnDefs: [{
orderable:
false
,
className:
'select-checkbox'
,
defaultContent:
""
,
targets: 0,
visible:
false
}, {
data: attname,
defaultContent:
""
,
targets: 1,
visible:
true
},
{
data:
""
,
defaultContent:
""
,
targets: 2,
visible:
true
}, {
data: base64value,
defaultContent:
""
,
targets: 3,
visible:
true
}],
select: {
style:
'single'
,
selector:
'td:first-child'
},
order: [
[2,
'asc'
]
],
"searching"
:
false
,
"retrieve"
:
true
,
"lengthChange"
:
false
});
},
error:
function
(err){
console.log(err);
}
});
}
Reply
Answers (
2
)
Unicode text issue with html sub pages in cordova
How to create drawing objects in Html 5?