Object not being initialized because javascript inside div?

Hello,

I am doing a project on which I want to use some of the controls. I followed the "getting started on linux" guide and I managed to get the calendar up and running.

I am using gambas3 as programming language to do my project. Gambas is a programming language in linux that allows to make really fast desktop or web applications.

Anyway, because of reasons, the html generated looks like this:

<div class="gw-html gw-noborder" id="@1.WebHtml2" style="flex-shrink:0;margin-top:0.5rem;">

<input id="startDate" type="text" />
div>

the generated javascript in my test page looks like this:

<div class="gw-form" id="@1"
 style="position:relative;flex-shrink:0;">
...stuff...​
<script type="text/javascript">
$(function () { 
 $("#startDate").ejDatePicker();
 })
script>div>

however, when debugging with Firefox,

$("#startDate").ejDatePicker();

returns undefined/null, which tells me the object can not be found by the javascript.

I can not change the way the code is generated, since it has to fit with the other stuff around the calendar. How can I initialize my control, given that both the javascript and the control are put inside divs, which I CAN NOT modify? (with this, I mean that I have no control over the finished code generated, whatever I do, it will always be put inside div tags).

Thanks for the help,



1 Reply

KR Keerthana Rajendran Syncfusion Team January 10, 2022 01:06 PM UTC

Hi Carlos , 
 
We understand that you are facing some issues with rendering the EJ1 DatePicker in your application.  
 
Kindly confirm whether you have referenced the required scripts and CSS on your end as mentioned in the below UG link. 
 
 
We have prepared a simple JavaScript sample by rendering both JavaScript and the input element within a div tag, which is working fine. 
 
 
Please modify the above sample like your element structure to recreate the issue along with the error details, which will help us to serve you better. 
 
Regards, 
Keerthana R. 


Loader.
Up arrow icon