jQWidgets Forums

jQuery UI Widgets Forums Grid Error on row select / pager

This topic contains 7 replies, has 2 voices, and was last updated by  punkrack 11 years, 10 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Error on row select / pager #27304

    punkrack
    Participant

    Hello!

    When using virtual mode and filtering, I then select a row. Event gets fired on row :

    …(.on(‘rowselect’, function (event) {

    var args = event.args;
    var row = args.rowindex;

    And row has the right rowindex.

    When changing the page, event gets still fired, row had the correct rowindex but the selection does not happen in the grid and I get this javascript error :

    TypeError: Cannot read property ‘uid’ of undefined [http://mysite.com/js/jqwidgets/jqxgrid.js:7]

    I’m using 3.0.1. Did not have this problem in 2.9.2.

    Thanks for checking this out.

    Error on row select / pager #27308

    Peter Stoev
    Keymaster

    Hi punkrack,

    Sorry, but I do not see such issue: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/virtualdata.htm?web. The sample is with Virtual Grid and you can select rows on any page. Would you provide a sample which demonstrates your scenario?

    Best Regards,
    Peter Stoev

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

    Error on row select / pager #27312

    punkrack
    Participant

    Hi Peter,

    In your example link, I cannot filter any column…
    If you do not filter any column, there is no problem.

    Try using a filter like filtering First Name : Nancy. And let me know if you did reproduce the problem.

    If not, I will provide an example.

    Error on row select / pager #27314

    Peter Stoev
    Keymaster

    Hi punkrack,

    Here’s a sample with Filtering and Virtual Data. In addition, I suggest you to check once more which version you use on your side.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title id='Description'>In this demo jqxGrid uses a virtualized paging which enables you to handle very large data sets without any impact on client side performance.</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="http://www.jqwidgets.com/jquery-widgets-demo/jqwidgets/jqx-all.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = "";
    // 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"
    ];
    // generate sample data.
    var generatedata = function (startindex, endindex) {
    var data = {};
    for (var i = startindex; i < endindex; 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["id"] = i;
    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;
    }
    return data;
    }
    var source =
    {
    datatype: "array",
    localdata: {},
    totalrecords: 1000000
    };
    // load virtual data.
    var rendergridrows = function (params) {
    var data = generatedata(params.startindex, params.endindex);
    return data;
    }
    var totalcolumnrenderer = function (row, column, cellvalue) {
    var cellvalue = $.jqx.dataFormat.formatnumber(cellvalue, 'c2');
    return '<span style="margin: 6px 3px; font-size: 12px; float: right; font-weight: bold;">' + cellvalue + '</span>';
    }
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    autoheight: true,
    source: dataAdapter,
    filterable: true,
    showfilterrow: true,
    theme: theme,
    virtualmode: true,
    pageable: true,
    rendergridrows: rendergridrows,
    columns: [
    { text: 'Id', datafield: 'id', width: 50 },
    { 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: 70, cellsalign: 'right' },
    { text: 'Unit Price', datafield: 'price', width: 70, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', datafield: 'total', cellsrenderer: totalcolumnrenderer, width: 100, cellsalign: 'right' }
    ]
    });
    $("#jqxgrid").on('rowselect', function (event) {
    var args = event.args;
    });
    });
    </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,
    Peter Stoev

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

    Error on row select / pager #27318

    punkrack
    Participant

    Hi Peter:

    Here is an example on how to reproduce the bug:

    http://colligetest.ccdmd.qc.ca/test-jqxwidgets/test.php

    I stripped down all the unecessary code I put. Grid starts on document.ready

    1) When grid loads, select a row, it selects it on page 1.
    2) Go to page 2, select a row, everything is fine.
    3) Filter column ‘Modèle’, with contains ‘bio’
    4) You get filtered results
    5) Select a row, everything is fine.
    6) Go to page 2, select a row, javascript error and row does not get selected EXCEPT the very first one on top.

    Using version 3.0.1.

    Waiting for feedback.

    Thanks!

    Error on row select / pager #27320

    punkrack
    Participant

    Here is an example with version 2.9.2

    Everything is fine if you repeat steps above

    http://colligetest.ccdmd.qc.ca/test-jqxwidgets/test292.php

    Error on row select / pager #27344

    Peter Stoev
    Keymaster

    Hi punkrack,

    That helped. I will add a work item.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Error on row select / pager #27434

    punkrack
    Participant

    Excellent!

    Looking forward for it to be fixed in the next release!

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

You must be logged in to reply to this topic.