Search code examples
jquery-uihighchartsjquery-ui-droppable

jQuery UI Shopping Cart in Tabs - After button-click draw Highcharts


I want that an user can select the graphs before the Highchart chart is drawn. Therefore I used jQuery UI droppable shopping cart.

After clicking on the continue button the computer should readout the selected items, ask for the data and draw the chart.

Link to jsFiddle : http://jsfiddle.net/FG9Fq/4/

// 1) collect items from shopping cart
/*
*  ??
* 
*/ 

How can I collect the data from the shopping cart?

And why does the click on the button do not set off the drawchart() function? At least I should get an alert().


Solution

  • 1) Remove all extra commas (see: http://jsfiddle.net/FG9Fq/6/). In general use jsLints or jsHints (in jsFiddle) to make your code a little better.

    2) Define function in that way: drawchart = function() { //set it global Example: http://jsfiddle.net/FG9Fq/7/

    3) I advice to create simple container (array for example), and when you will drop element add that element to that container. Then you will be able pretty fast look through that array and od something with that items.