jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • in reply to: Select All Checkbox Select All Checkbox #62439

    jkapasi
    Participant

    Hello,

    I want to know that which event will be fired when I select the checkbox in the header of checkbox column. Is there any event which will be fired?

    Regards,
    Jash

    in reply to: Get row count of current page Get row count of current page #62432

    jkapasi
    Participant

    Thanks for your response.

    I tried your example but it gives me the value of page size as the value selected in the page size dropdown.

    I need the count of the rows seen on current page. If the grid has only 2 rows on a particular page when page size is 10, it should return me 2 instead of 10.

    Regards,
    Jash Kapasi

    in reply to: Refresh on sort Refresh on sort #62284

    jkapasi
    Participant

    Thanks for the response.

    It is working now.

    in reply to: Installation Installation #61494

    jkapasi
    Participant

    I tried all possible ways of referencing the script files.

    I have used the same example from the demos. But I am still facing the same problem of dataadapter.

    in reply to: Installation Installation #61490

    jkapasi
    Participant

    I removed two js file which were included in the code – jquery-1.10.2.min.js and jquery.js.
    Instead of these two I only kept jquery-1.11.1.min.js.

    Now I am getting the following error :

    ‘Unable to get property ‘dataAdapter’ of undefined or null reference’.

    I am getting this error at following line:

    var dataAdapter = new $.jqx.dataAdapter(source, {
        loadComplete: function (data) { },
        loadError: function (xhr, status, error) { }    
    });
    in reply to: Installation Installation #61488

    jkapasi
    Participant

    Thank you for your response.

    But where can I find ‘jquery.js’ file?

    Following is the code which gives me the error in the dataAdapter initialization:

    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title id='Description'>Grid populated from JSON.</title>
            <link rel="stylesheet" href="js/jqwidgets/styles/jqx.base.css" type="text/css" />
            <script type="text/javascript" src="js/jqwidgets/scripts/jquery-1.10.2.min.js"></script>
            <script type="text/javascript" src="js/jqwidgets/scripts/jquery-1.11.1.min.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxcore.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxdata.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxbuttons.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxscrollbar.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxmenu.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxlistbox.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxdropdownlist.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.js"></script>
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.selection.js"></script> 
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.columnsresize.js"></script> 
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.filter.js"></script> 
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.sort.js"></script> 
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.pager.js"></script> 
            <script type="text/javascript" src="js/jqwidgets/jqxgrid.grouping.js"></script> 
            <script type="text/javascript" language="javascript" src="js/jquery.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                // 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"
    ];
    for (var i = 0; i < 1000; 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,
        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="jqxgrid1"></div>
            </div>
        </body>
    </html>
Viewing 6 posts - 16 through 21 (of 21 total)