jQWidgets Forums

jQuery UI Widgets Forums Chart How to generate a jqxChart on click?

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • How to generate a jqxChart on click? #25377

    CleanSock
    Member

    I have a function to create a jqxGrid within which I am creating a toolbar for that grid and a button on that toolbar.

    rendertoolbar: function (toolbar) {                    
    var container = $("<div style='margin: 5px;'></div>");
    var span = $("<span style='float: left; margin-top: 5px; margin-right: 4px;'>"+ parameterName + "</span>");
    var chartName = 'chartButton';
    var button = $("<input style='margin-top: 5px; float: right;' type='Button' value='Chart' id="+chartName+" onclick='javascript:showMessage(this)'/>");
    toolbar.append(container);
    container.append(span);
    container.append(button);
    }

    The grid is not loaded automatically but only when called on click of another button. I want the user to be able to view the chart onclick of the chart button once the grid is loaded.
    How to do that? Any help would be appreciated.

    P.S : I want to make a simple Column Series chart using JSON values from the server.

    How to generate a jqxChart on click? #25390

    Dimitar
    Participant

    Hello CleanSock,

    You should call the chart initialization code on the click event of the button in the grid’s toolbar, i.e.:

    $("#" + chartName).click(function () {
    // chart initialization
    });

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.