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.9k
Add date icon beside date value in data table
Feb 17 2020 2:46 AM
Hi there,
I tried to add date icon to table data in Datatable,as per my code icon is getting added down. But I need to show it beside the date.When i tried to add image on render then it is simply showing image but onclick of it it is not showing calender..Onclick of date icon it should show calender.
Can someone help ?to add icon beside date and onclick of it need to show calender
Here is my code
, {
"targets"
: 5,
"data"
:
"payment_date"
,
"class"
:
"datecell"
,
"render"
:
function
(data) {
if
(data!=
""
)
{
var
DateArray = isNullData(data).split(
'T'
);
var
finalDate = DateArray[0];
formateDate = moment(DateArray[0]).local().format(
"MM/DD/YYYY"
);
return
'<input value="'
+ isNullData(formateDate)+
'" style="display: inline-block;width: 60%;" class="table-output datecell payment_date_inp form-control" data-toggle="tooltip" data-placement="right" title="'
+isNullData(formateDate)+
'" /><span style="display: none;">'
+isNullData(formateDate)+
'</span></div>'
;
}
else
{
var
a=
new
Date();
formateDate = moment(a[0]).local().format(
"MM/DD/YYYY"
);
return
'<input value="'
+ isNullData(formateDate)+
'" style="display: inline-block;width: 60%;" class="table-output datecell payment_date_inp form-control" data-toggle="tooltip" data-placement="right" title="'
+isNullData(formateDate)+
'" /><span style="display: none;">'
+isNullData(formateDate)+
'</span></div>'
;
}
}
}
createdRow:
function
(row) {
//$(".datecell", row).datepicker();
$(
".datecell"
, row).datepicker({
showOn:
'button'
,
buttonImage:
'images/lookup-date.png'
,
buttonImageOnly:
true
});
}
Reply
Answers (
1
)
following jquery code not working when deployed on servers
section stable in jquery.