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({
- showOn: 'button',
- buttonImage: 'images/lookup-date.png',
- buttonImageOnly: true
- });
- }