jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Set item context Set item context #15519

    stonezhong
    Member

    Hi Dimitar,

    Thank you for the reply.

    Here is my code:

    When I click on “foo”, I expect to see “Object”, I saw “string” instead.

    Thanks,
    Stone

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fx>
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxtree.js"></script>
    <script type="text/javascript">
    $(function() {
    var items = [
    {expanded: false, label: "foo"},
    {expanded: false, label: "bar"}
    ];
    items[0].value = items[0];
    items[1].value = items[1];
    $('#jqxTree').jqxTree({ source: items, height: '300px', width: '300px' });
    $('#jqxTree').bind("select", function(event) {
    var args = event.args;
    var item = $('#jqxTree').jqxTree('getItem', args.element);
    alert(typeof(item.value));
    });
    });
    </script>
    </head>
    <body>
    <div id='jqxTree'></div>
    </body>
    </html>
Viewing 1 post (of 1 total)