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
Abdalla Elawad
NA
1k
216.5k
how to display date format Jason DataTable ?
Jan 14 2019 5:15 AM
Hi Guys
pls help me
I am trying to display some data in a datatable and the table script I am using is
<script>
$(document).ready(
function
(){
$.ajax({
url:
'Item_WebService.asmx/GetItem'
,
method:
'post'
,
dataType:
'json'
,
success:
function
(data) {
$(
'#datatable'
).dataTable({
'scrollY'
: 300,
data: data,
columns :[
{
'data'
:
'Model'
},
{
'data'
:
'PartNo'
},
{
'data'
:
'ItemDesc'
},
{
"data"
:
"ReceivedDate"
,
"render"
:
function
(data) {
var
date =
new
Date(data);
var
month = date.getMonth() + 1;
return
(month.length > 1 ? month :
"0"
+ month) +
"/"
+ date.getDate() +
"/"
+ date.getFullYear();
},
}
],
dom:
'Bfrtip'
,
buttons: [
'copyHtml5'
,
'excelHtml5'
,
'csvHtml5'
,
{
extend:
'pdfHtml5'
,
orientation:
'portiat'
,
pageSize:
'LEGAL'
,
customize:
function
(doc) {
doc.content[1].table.widths =
Array(doc.content[1].table.body[0].length + 1).join(
'*'
).split(
''
);
doc.defaultStyle.alignment =
'left'
;
doc.styles.tableHeader.alignment =
'left'
;
}
}
]
});
}
});
});
</script>
Reply
Answers (
5
)
Why should I learn Struct In C#?
storing Multiple user’s sing in information