taitems / jQuery.Gantt

jQuery Gantt Chart
http://taitems.github.io/jQuery.Gantt/
MIT License
952 stars 304 forks source link

How to use the functions onItemClick: function(data) and $(".gantt").popover({ #252

Closed clausowitz closed 1 year ago

clausowitz commented 2 years ago

I succesfully implemented the jQuery Gantt on my sharepoint list. Now I would like to use the onItemClick function and the popover function. How do I change alert("Item clicked - show some details"); to something more meaningfull like opening the list item in another page? I tried following but I get an error saying Unable to get property 'itemData' of undefined or null reference onItemClick: function(data) { var itemData = data.itemData; var itemElement = data.itemElement; var itemIndex = data.itemIndex; console.log(itemData); alert(itemData); },

Furthermore I would like to change the popover. Showing the Title in the popup is helpful but the content displaying content: "Here's some useful information.", I would like to show some more info from the listitem.

usmonster commented 1 year ago

Hi, and sorry for the huge respoonse latency! Thanks for asking your questions here.

To clarify your first issue, the data parameter will only be present if you include a dataObj in the values you use to populate the chart.

To answer your second question, the popover functionality you see in the demo comes strictly from a separate Bootstrap plugin and has no related code in the Gantt plugin itself. You can see in the demo page how we get the title, and you can do something similar to show custom content by getting the data directly off the element.

Hope this helps!