jQWidgets Forums

Forum Replies Created

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts

  • Peter Sloth
    Participant

    Hi Mariya

    thanks for the reply. However, I want the link to be invoked when the node (which contains the link) gets selected – for instance when I select it using the keyboard.
    In your sample code it is only possible to invoke the link using the mouse.

    thanks
    //Peter


    Peter Sloth
    Participant

    Unfortunately ajax callbacks is not an option. The web application is an old lecay asp application which makes use of a bunch of COM dlls to get the data from the database (yes, I know that this is pretty crappy!).

    I can see from the demo projects that some of the pages make use of cookies to keep the state after a page refresh. I assume this can be used for keeping the tree view selection after a post back?

    thanks

    //Peter


    Peter Sloth
    Participant

    Hi Peter

    thanks for the answer.

    It seems to work if I just remove the position: absolute from the div element which contains the grid.
    Then I don’t need to worry about z-index 🙂

    thanks

    //Peter


    Peter Sloth
    Participant

    Hi

    I found it!

    thanks a lot

    Bests
    Peter


    Peter Sloth
    Participant

    Hi Peter

    It works perfectly! Thanks a lot.

    Bests
    Peter Sloth


    Peter Sloth
    Participant

    ooops, that didn’t seem to work. Trying again using a code-block

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title id='Description'>VQ test page</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css">
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.metro.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.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/jqxcheckbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxtree.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxexpander.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxsplitter.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getDemoTheme();
    theme = 'metro';
    // Create jqxTree
    $('#jqxTree').jqxTree({ theme: theme, height: '100%', width: '100%' });
    $('#mainSplitter').jqxSplitter({ theme: theme, width: '100%', height: '100%', panels: [{ size: '20%' }, { size: '80%' }] });
    $('#rightSplitter').jqxSplitter({ theme: theme, height: '100%', orientation: 'horizontal', panels: [{ size: '80%', collapsible: false }, { size: '20%' }] });
    /* ==================== */
    // prepare the data
    var data = new Array();
    var firstNames =
    [
    "Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin", "Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
    ];
    var lastNames =
    [
    "Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson", "Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
    ];
    var productNames =
    [
    "Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha", "Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
    ];
    var priceValues =
    [
    "2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
    ];
    var available =
    [
    "true", "false", "false", "false", "false", "true", "false", "false", "false", "false", "false", "false"
    ];
    for (var i = 0; i < 200; i++) {
    var row = {};
    var productindex = Math.floor(Math.random() * productNames.length);
    var price = parseFloat(priceValues[productindex]);
    var quantity = 1 + Math.round(Math.random() * 10);
    row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
    row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
    row["productname"] = productNames[productindex];
    row["price"] = price;
    row["quantity"] = quantity;
    row["total"] = price * quantity;
    row["available"] = available[productindex];
    row["summary"] = "<table><tr><td><b>" + "First name: " + "</b></td><td style='width=100%'>" + row["firstname"] + "</td></tr><tr><td><b>" + "Last name: " + "</b></td><td style='width=100%'>" + row["lastname"] + "</td></tr></table >";
    data[i] = row;
    }
    var source =
    {
    localdata: data,
    datatype: "array",
    datafields:
    [
    { name: 'firstname', type: 'string' },
    { name: 'lastname', type: 'string' },
    { name: 'productname', type: 'string' },
    { name: 'available', type: 'bool' },
    { name: 'quantity', type: 'number' },
    { name: 'price', type: 'number' },
    { name: 'total', type: 'number' },
    { name: 'summary', type: 'string' }
    ]
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").jqxGrid(
    {
    source: dataAdapter,
    width: '100%',
    height: '100%',
    altrows: true,
    theme: theme,
    columns: [
    { text: 'Name', dataField: 'firstname', width: 100 },
    { text: 'Last Name', dataField: 'lastname', width: 100 },
    { text: 'Product', editable: false, dataField: 'productname', width: 180 },
    { text: 'Available', editable: false, datafield: 'available', threestatecheckbox: true, columntype: 'checkbox', width: 70 },
    { text: 'Quantity', dataField: 'quantity', width: 80, cellsalign: 'right' },
    { text: 'Unit Price', dataField: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', dataField: 'total', cellsalign: 'right', minwidth: 100, cellsformat: 'c2' }
    ]
    });
    /* ==================== */
    $("#jqxgrid").on('rowselect', function (event) {
    var summary = event.args.row.summary;
    $("#PreviewPanel").html("<div style='margin: 10px;'>" + summary + "</div>");
    });
    });
    </script>
    <style type="text/css">
    div#ContentPanel
    {
    padding: 4px;
    overflow: hidden;
    }
    a:visited, a:hover, a:active
    {
    color: inherit;
    }
    html, body
    {
    height: 100%;
    width: 100%;
    margin: 0px;
    padding: 0px;
    overflow: hidden;
    }
    </style>
    </head>
    <body class='default'>
    <div id="mainSplitter">
    <div>
    <div style="border: none;" id='jqxTree'>
    <ul>
    <li id="Mail" item-expanded='true'>
    <img style='float: left; margin-right: 5px;' src='../../images/mailIcon.png'><span
    item-title="true">Mail</span>
    <ul>
    <li id="Calendar" item-expanded='true'>
    <img style='float: left; margin-right: 5px;' src='../../images/calendarIcon.png'><span
    item-title="true">Calendar</span> </li>
    <li id="Contacts">
    <img style='float: left; margin-right: 5px;' src='../../images/contactsIcon.png'><span
    item-title="true"><a style="text-decoration: none;" href="vq.htm?module=contacts">Contacts</a></span> </li>
    <li id="Inbox">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true"> <span><b>Inbox</b></span><span style='color: Blue'> (3)</span></span>
    <ul>
    <li id="jQWidgets">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">jQWidgets</span>
    <ul>
    <li id="Admin">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Admin</span> </li>
    <li id="Corporate">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Corporate</span> </li>
    <li id="Finance">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Finance</span> </li>
    <li id="Other">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Other</span> </li>
    </ul>
    </li>
    <li id="Personal">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Personal</span> </li>
    </ul>
    </li>
    <li id="Deleted Items" item-expanded='true'>
    <img style='float: left; margin-right: 5px;' src='../../images/recycle.png'><span
    item-title="true"> <span>Deleted Items</span><span style='color: Blue;'> (10)</span></span>
    <ul>
    <li id="Today">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Today</span> </li>
    <li id="Last Week">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Last Week</span> </li>
    <li id="Last Month">
    <img style='float: left; margin-right: 5px;' src='../../images/folder.png'><span
    item-title="true">Last Month</span> </li>
    </ul>
    <li id="Notes">
    <img style='float: left; margin-right: 5px;' src='../../images/notesIcon.png'><span
    item-title="true">Notes</span> </li>
    <li id="Settings">
    <img style='float: left; margin-right: 5px;' src='../../images/settings.png'><span
    item-title="true">Settings</span> </li>
    <li id="Favorites">
    <img style='float: left; margin-right: 5px;' src='../../images/favorites.png'><span
    item-title="true">Favorites</span> </li>
    </ul>
    </li>
    </ul>
    </div>
    </div>
    <div>
    <div id="rightSplitter">
    <div id="ContentPanel">
    <div style="height: 30px;width: 100%; background-color: lightgreen">Top Panel</div>
    <div style="height: 30px;width: 100%; background-color: lightsalmon; margin-bottom: 5px;">Grid Toolbar</div>
    <div id='jqxWidget'>
    <div id="jqxgrid">
    </div>
    </div>
    </div>
    <div id="PreviewPanel">
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>

    Peter Sloth
    Participant

    Hi

    thanks for the quick reply. It doesn’t seem to work, however. I have modified one of the existing demo pages (see below)

    What am I doing wrong here?

    thanks

    //Peter

    VQ test page

    $(document).ready(function () {
    var theme = getDemoTheme();
    theme = ‘metro’;

    // Create jqxTree
    $(‘#jqxTree’).jqxTree({ theme: theme, height: ‘100%’, width: ‘100%’ });

    $(‘#mainSplitter’).jqxSplitter({ theme: theme, width: ‘100%’, height: ‘100%’, panels: [{ size: ‘20%’ }, { size: ‘80%’ }] });
    $(‘#rightSplitter’).jqxSplitter({ theme: theme, height: ‘100%’, orientation: ‘horizontal’, panels: [{ size: ‘80%’, collapsible: false }, { size: ‘20%’ }] });

    /* ==================== */

    // prepare the data
    var data = new Array();

    var firstNames =
    [
    “Andrew”, “Nancy”, “Shelley”, “Regina”, “Yoshi”, “Antoni”, “Mayumi”, “Ian”, “Peter”, “Lars”, “Petra”, “Martin”, “Sven”, “Elio”, “Beate”, “Cheryl”, “Michael”, “Guylene”
    ];

    var lastNames =
    [
    “Fuller”, “Davolio”, “Burke”, “Murphy”, “Nagase”, “Saavedra”, “Ohno”, “Devling”, “Wilson”, “Peterson”, “Winkler”, “Bein”, “Petersen”, “Rossi”, “Vileid”, “Saylor”, “Bjorn”, “Nodier”
    ];

    var productNames =
    [
    “Black Tea”, “Green Tea”, “Caffe Espresso”, “Doubleshot Espresso”, “Caffe Latte”, “White Chocolate Mocha”, “Cramel Latte”, “Caffe Americano”, “Cappuccino”, “Espresso Truffle”, “Espresso con Panna”, “Peppermint Mocha Twist”
    ];

    var priceValues =
    [
    “2.25”, “1.5”, “3.0”, “3.3”, “4.5”, “3.6”, “3.8”, “2.5”, “5.0”, “1.75”, “3.25”, “4.0”
    ];

    var available =
    [
    “true”, “false”, “false”, “false”, “false”, “true”, “false”, “false”, “false”, “false”, “false”, “false”
    ];

    for (var i = 0; i < 200; i++) {
    var row = {};
    var productindex = Math.floor(Math.random() * productNames.length);
    var price = parseFloat(priceValues[productindex]);
    var quantity = 1 + Math.round(Math.random() * 10);

    row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
    row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
    row["productname"] = productNames[productindex];
    row["price"] = price;
    row["quantity"] = quantity;
    row["total"] = price * quantity;
    row["available"] = available[productindex];
    row["summary"] = "” + “First name: ” + “” + row[“firstname”] + “” + “Last name: ” + “” + row[“lastname”] + “”;

    data[i] = row;
    }

    var source =
    {
    localdata: data,
    datatype: “array”,
    datafields:
    [
    { name: ‘firstname’, type: ‘string’ },
    { name: ‘lastname’, type: ‘string’ },
    { name: ‘productname’, type: ‘string’ },
    { name: ‘available’, type: ‘bool’ },
    { name: ‘quantity’, type: ‘number’ },
    { name: ‘price’, type: ‘number’ },
    { name: ‘total’, type: ‘number’ },
    { name: ‘summary’, type: ‘string’ }
    ]
    };

    var dataAdapter = new $.jqx.dataAdapter(source);
    $(“#jqxgrid”).jqxGrid(
    {
    source: dataAdapter,
    width: ‘100%’,
    height: ‘100%’,
    altrows: true,
    theme: theme,
    columns: [
    { text: ‘Name’, dataField: ‘firstname’, width: 100 },
    { text: ‘Last Name’, dataField: ‘lastname’, width: 100 },
    { text: ‘Product’, editable: false, dataField: ‘productname’, width: 180 },
    { text: ‘Available’, editable: false, datafield: ‘available’, threestatecheckbox: true, columntype: ‘checkbox’, width: 70 },
    { text: ‘Quantity’, dataField: ‘quantity’, width: 80, cellsalign: ‘right’ },
    { text: ‘Unit Price’, dataField: ‘price’, width: 90, cellsalign: ‘right’, cellsformat: ‘c2’ },
    { text: ‘Total’, dataField: ‘total’, cellsalign: ‘right’, minwidth: 100, cellsformat: ‘c2’ }
    ]
    });

    /* ==================== */

    $(“#jqxgrid”).on(‘rowselect’, function (event) {
    var summary = event.args.row.summary;
    $(“#PreviewPanel”).html(“

    ” + summary + “

    “);
    });

    });

    div#ContentPanel
    {
    padding: 4px;
    overflow: hidden;
    }

    a:visited, a:hover, a:active
    {
    color: inherit;
    }

    html, body
    {
    height: 100%;
    width: 100%;
    margin: 0px;
    padding: 0px;
    overflow: hidden;
    }

    Mail

    Calendar

    Contacts

    Inbox (3)

    jQWidgets

    Admin

    Corporate

    Finance

    Other

    Personal

    Deleted Items (10)

    Today

    Last Week

    Last Month

    Notes

    Settings

    Favorites

    Top Panel
    Grid Toolbar

    in reply to: Json data Json data #21927

    Peter Sloth
    Participant

    Hi Mariya

    you are absolutely right!

    thanks a lot

    Bests
    Peter

    in reply to: Keep state? Keep state? #20234

    Peter Sloth
    Participant

    Dimitar,

    thanks! It works perfectly 🙂

    Best regards
    Peter

Viewing 9 posts - 16 through 24 (of 24 total)