custom-widgets icon indicating copy to clipboard operation
custom-widgets copied to clipboard

About third-party date and time widgets

Open fengzhihenxs opened this issue 5 years ago • 7 comments

Now the officially supported third-party date widget is bootstrap datepicker, but bootstrap datepicker cannot set the time part. Is there a way to support bootstrap datetimepicker, so that a widget date, time, datetime can be supported.

fengzhihenxs avatar Jun 12 '20 08:06 fengzhihenxs

Yes, you can implement a custom date time picker widget using the https://github.com/surveyjs/widgets/blob/master/src/bootstrapdatepicker.js widget code as a basis.

tsv2013 avatar Jun 13 '20 20:06 tsv2013

@tsv2013 Thank you very much, I have implemented bootstrap datatimepicker. After the implementation, there is a small problem that needs to be asked to you: When the scroll bar appears in the survey container, scroll the scroll bar of the survey container, the datatimepicker window is fixed on the current page, and does not move with the scroll bar, but when the survey container does not appear the scroll bar When scrolling the scroll bar of the survey container, the datatimepicker window moves with the scroll bar. I think this is not reasonable. Is there a solution?

This is an example:https://plnkr.co/edit/lPfGBzQpEa98Gbch?preview

fengzhihenxs avatar Jun 15 '20 06:06 fengzhihenxs

Just now is the bootstrap datepicker example, which is also true. The following is the case of bootstrap datatimepicker. image

fengzhihenxs avatar Jun 15 '20 06:06 fengzhihenxs

@fengzhihenxs for some reason I think it’s caused by bootstrap... propably popup container is misplaced

tsv2013 avatar Jul 07 '20 12:07 tsv2013

@tsv2013 Hi, I am trying to add one of the custom widget to survey creator toolbox but getting failed...plz help. i m referring this example https://codesandbox.io/s/crazy-rain-3wqj7?file=/src/customwidget.js

sirajansari3 avatar Dec 21 '20 08:12 sirajansari3

Answered here - https://surveyjs.answerdesk.io/ticket/details/t5959/unable-to-add-custom-widget-to-creator-toolbox

tsv2013 avatar Dec 21 '20 10:12 tsv2013

Hello @fengzhihenxs , Could you share the widget.js code for bootstrap datatimepicker .

Mahesh4Providence avatar Mar 24 '21 07:03 Mahesh4Providence