jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 785 total)
  • Author
    Posts

  • Nadezhda
    Participant

    Hello Ioana,

    Here is an example which shows how to create a Grid from Array data. I hope it will be helpful to you.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title></title>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.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/jqxmenu.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.edit.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                // prepare the data
                var data = new Array();
                var firstNames =
                [
                    "Andrew"
                ];
                var lastNames =
                [
                    "Fuller"
                ];
                var productNames =
                [
                    "Black Tea"
                ];
                var priceValues =
                [
                    "2.25"
                ];
                for (var i = 0; i < 1; 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;
                    data[i] = row;
                }
                var source =
                {
                    localdata: data,
                    datatype: "array"
                };
                var dataAdapter = new $.jqx.dataAdapter(source, {
                    loadComplete: function (data) { },
                    loadError: function (xhr, status, error) { }
                });
                $("#jqxgrid").jqxGrid(
                {
                    source: dataAdapter,
                    autoheight: true,
                    editable: true,
                    selectionmode: 'singlecell',
                    columns: [
                      { text: 'First Name', datafield: 'firstname', width: 100 },
                      { text: 'Last Name', datafield: 'lastname', width: 100 },
                      { text: 'Product', datafield: 'productname', width: 180 },
                      { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
                      { text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
                      { text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
                    ]
                });
            });
        </script>
    </head>
    <body class='default'>
    <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
        <div id="jqxgrid"></div>
    </div>
    </body>
    </html>

    Best Regards,
    Nadezhda

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

    in reply to: Printing content of window Printing content of window #71168

    Nadezhda
    Participant

    Hi sjkcwatson,

    Here is another example which shows how to get the Windows’s HTML, add it to a new browser window and trigger printing.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title></title>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.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/jqxwindow.js"></script>
    </head>
    <body>
        <div id='content'>
            <script type="text/javascript">
                $(document).ready(function () {
                    $("#jqxwindow").jqxWindow({
                        height: 100,
                        width: 300,
                    });
                    $("#print").jqxButton();
                    $("#print").click(function () {
                        var content = $('#jqxwindow').jqxWindow('content');
                        var newWindow = window.open('', '', 'width=300, height=100'),
                            document = newWindow.document.open(),
                             pageContent =
                            '<!DOCTYPE html>\n' +
                            '<html>\n' +
                            '<head>\n' +
                            '<meta charset="utf-8" />\n' +
                            '<title>jQWidgets Window</title>\n' +
                            '</head>\n' +
                            '<body>\n' + content + '\n</body>\n</html>';
                        document.write(content);
                        document.close();
                        newWindow.print();
                    });
                });
            </script>
            <div id='jqxwindow'>
                <div>Header</div>
                <div>Content</div>
            </div>
            <div style='margin-left: 10px; float: left;'>
                <input type="button" value="Print" id='print' />
            </div>
        </div>
    </body>
    </html>

    Best Regards,
    Nadezhda

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

    in reply to: Printing content of window Printing content of window #71164

    Nadezhda
    Participant

    Hello sjkcwatson,

    Unfortunately, exporting from jqxWindow is not available. You may try the following example as a workaround which exports window’s content in file: http://jsfiddle.net/9fjLah0p/.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello nab054371,

    Our Development plans are available online: http://www.jqwidgets.com/roadmap/.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello Rahul,

    Please, provide us with a jsfiddle example which demonstrates your issue so we can determine how to help you best.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello Iyanar K,

    Here is an example which shows how to restrict input special characters like $ and #. I hope it will be helpful to you.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title></title>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                // Create jqxNumberInput
                $("#numericInput").jqxNumberInput({ width: '250px', height: '25px', min: 0, max: 1000});
                // Create currency Input.
                $("#currencyInput").jqxNumberInput({ width: '250px', height: '25px', min: 0, max: 1000, symbol: '$'});
                // Create custom validation Input.
                $("#validation").jqxNumberInput({ width: '250px', height: '25px', min: 0, max: 1000, value: 0 });
                $('.jqx-input-content').keypress(function (key) {
                    if (key.charCode == 35 || key.charCode == 36) return false;
                });
            });
        </script>
    </head>
    <body class='default'>
        <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
            <div>The input is restricted from 0 to 1000</div>
            <div style='margin-top: 10px;'>
                Number</div>
            <div style='margin-top: 3px;' id='numericInput'>
            </div>
            <div style='margin-top: 10px;'>
                Currency</div>
            <div style='margin-top: 3px;' id='currencyInput'>
            </div>
            <div style='margin-top: 10px;'>
                Custom Validation Message</div>
            <div style='margin-top: 3px;' id='validation'>
            </div>
        </div>
    </body>
    </html>

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello dineshnk,

    Unfortunately, this scenario is not supported. You can display the jqxTree in a popup with the jqxDropDownButton. You may look at DropDown Tree demo.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hi Amit,

    Please, provide us with a code sample or JSFiddle example demonstrating the behaviour so we can test to determine the source of the issue.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hi cpuin,

    Would you be able to reproduce this issue in a small JSFiddle example so that we may run your code and test it?

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com

    in reply to: Link in tooltip? Link in tooltip? #71060

    Nadezhda
    Participant

    Hi timwoj,

    This cannot be achieved, unfortunately, but if you want you can set ‘closeOnClick’ property to false to disable closing tooltip on click.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hi cpuin,

    Please, note that in our latest example the check for values in jqxInput is separated for each input field. With the following line of code
    if ($('#company').jqxInput('val').length == 0 && $('#warehouse').jqxInput('val').length == 0) { you will disable save button only if warehouse and company are empty in the same time.

    If this does not help you, please, provide us with full sample code including all your jqxInput initializations and html code.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com


    Nadezhda
    Participant

    Hello hh_shan,

    You may try to use dataAdapter’s records. For more information you can refer to Grid Data Sources help topic: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-datasources.htm.
    I hope it will be helpful to you.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello Coloco,

    I would suggest you update to the latest version of jQWidgets (3.8.0). For more information you may refer to the following forum topic: http://www.jqwidgets.com/community/topic/singlerow-doesnt-work-parsedate-error-in-jqxdata-js/#post-71025.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hi cpuin,

    Here is an example which shows how to check values in four jqxInput when you set them dynamically: http://jsfiddle.net/u5qjc7vo/. I hope it will be helpful to you.

    Best Regards,
    Nadezhda

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


    Nadezhda
    Participant

    Hello Gopinath BS,

    We could not reproduce the reported issue when selecting/unselecting all rows and select single row after that. Please, make sure you are using the latest version of jQWidgets (3.8.0).

    Best Regards,
    Nadezhda

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

Viewing 15 posts - 1 through 15 (of 785 total)