JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Gantt › Programmatically adding elements to GanttChart › Reply To: Programmatically adding elements to GanttChart
June 24, 2022 at 8:17 am
#103325
valve1023@gmail.com
Participant
hello.
insertTask function does not work.
Below is the sample code.
Maybe jQuery is the problem?
How do I solve this?
Sorry for being written by a translator.
Thank you.
$(document).ready(function () { const ganttchart = document.querySelector('smart-gantt-chart'); const result = ganttchart.insertTask({ label: "Project1", dateStart: '2021-01-01', dateEnd: '2021-06-31', type: "project" }); }); Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf') at BaseElement.insertTask (smart.elements.js:83:32164) at BaseElement.r (smart.elements.js:6:72232) at HTMLDocument.<anonymous> (001.aspx:152:39) at j (jquery-1.11.1.min.js:2:27244) at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2:28057) at Function.ready (jquery-1.11.1.min.js:2:29891) at HTMLDocument.J (jquery-1.11.1.min.js:2:30257)
</div>
- This reply was modified 2 years, 6 months ago by valve1023@gmail.com.