jQWidgets Forums

jQuery UI Widgets Forums Grid Data Display in Grid Problem

This topic contains 8 replies, has 2 voices, and was last updated by  Tone 12 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Data Display in Grid Problem #9410

    Tone
    Member

    I certainly hope this is a familiar problem with an easy enough answer.

    In creating a grid that is bound to a fairly standard data table ( like a northwinds table ), i am getting the No Data to Display error.
    I have spent a lot of time finding and squashing my own errors, but this is ODD…
    It works fine for the first several fields, both character and number, but then i add one more, bang! NO GO….
    There are lots of records in the table ( approx 35,000 ) but mysql handles it no sweat.
    The table is collated in Latin1 swedish ci but then so is the Northwinds db and all the examples work flawlessly.
    i have sucessfully done a browse page on another table in my db without problems and it has char, num, currency and date fields.
    it does not seem to matter which of the fields in my table get added. Once i cross that line, it’s No data to display.
    I have used the example in the phpdemos folder as the skeleton, adding only a look.

    here is a bit of the code

    $(“#jqxgrid”).jqxGrid(
    {
    source: source,
    width : ‘100%’,
    height : ‘80%’,
    theme: ‘classic’,
    columns: [
    { text: ‘item’, datafield: ‘item’, width: 250},
    { text: ‘descrip’, datafield: ‘descrip’, width: 250},
    { text: ‘SUPPLIER’, datafield: ‘supplier’, width: 100 },
    { text: ‘ONHAND’, datafield: ‘onhand’, width: 100, cellsalign: ‘right’ },
    { text: ‘ONORDER’, datafield: ‘onorder’, width: 100, cellsalign: ‘right’ },
    { text: ‘ALOC’, datafield: ‘aloc’, width: 100, cellsalign: ‘right’ },
    { text: ‘Category’, datafield: ‘category’, width: 300 }
    ]

    I am sure this is familiar to many.
    Anyway works fine without the category field but returns no data when category is added, or unitms (unit of measure), or any other field and it doesn’t seem to matter if it is character or numeric.

    any ideas?

    Thanks
    Tone

    Data Display in Grid Problem #9413

    Peter Stoev
    Keymaster

    Hi Tone,

    The provided information is not enough for reproducing the error. Please post a complete sample, or send us a sample to support@jqwidgets.com.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data Display in Grid Problem #9465

    Tone
    Member

    Thank you for your reply in so prompt a manner. This reflects very well on my impending decision to adopt a specific ui framework.
    I knew that the supplied snippet wasn’t enough, i was hoping that the situation was common enough that someone might already know what the issue was.

    Thanks and i will send along something that will allow a test.

    Tone

    Data Display in Grid Problem #9492

    Tone
    Member

    Well, well.
    In preparing a special version to send you to replicate the issue, i exported some of the data to a new database, updated the connection string, and now it works! i have even added a few more fields to get it to “break” and no joy. Don’t yet know what is happenning with the original database or what.

    If the original data still bucks, i might need to send it, or put it up where you can see it in action.
    If i figure out what I did wrong or how the data was interfering with jqwidgets, i’ll get back to you.

    Still, thank You for your Outstanding time of response. 🙂

    Tone

    Data Display in Grid Problem #9493

    Tone
    Member

    Ahh

    Well it is the size of the fetched data i guess.
    Works great up to 29000 records without a paging hook required, hit 30000 and “No Data to Display”
    I tested to see if it was the data by changing the LIMIT clause to 29000,32000 and it went right back to work.
    Just need to be aware that some things need paging!

    Is there a specific number of rows i can pile into the grid? or the total of (rows * fields)?

    Regardless i am very happy that it works and if there is a limit i missed in the docs, my most humble apologies!
    A few more test pages and i will need to license this beautiful group of goodies.

    Thanks again

    Tone

    Data Display in Grid Problem #9495

    Peter Stoev
    Keymaster

    Hi Tone,

    There aren’t any limits of the data displayed in the Grid, but if you experience an issue, we will be glad to investigate and debug it.

    Sample with 50 000 records loaded in the Grid.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.8.2.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.pager.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getTheme();
    // 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 < 50000; 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;
    }
    var source =
    {
    localdata: data,
    datatype: "array"
    };
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    source: source,
    theme: theme,
    pageable: true,
    autoheight: true,
    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: 80, cellsalign: 'right' },
    { text: 'Unit Price', datafield: 'price', width: 80, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', datafield: 'total', 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,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data Display in Grid Problem #9571

    Tone
    Member

    Thanks Peter!

    I will continue to investigate my data then as the cause of that …

    I am also trying to resolve an issue with the cellsformat: ‘c2’ call in the grid setup.
    i am not getting any change to the render of the cells.
    They still have no decimals or 1 or 2 depending on price and no dollar sign. ( ala float )
    The table field is shown as ” double ” in the phpmyadmin structure list.
    I see in the docs that i can have a custom render of cells in the grid, but i certainly would like to get the currency thing going since a ton of my fields are currency.

    this is how i have been doing the call

    { text: ‘PTDSLS’, datafield: ‘ptdsls’, width: 100, cellsalign: ‘right’, type: ‘float’, cellsformat: ‘F2’ },

    i just stuck the ‘float’ in there this afternoon to see if it might help. but not yet anyway.

    Any ideas off the cuff?

    oh, and thanks again for helping out only a ‘potential’ customer…

    Tone

    Data Display in Grid Problem #9576

    Peter Stoev
    Keymaster

    Hi Tone,

    The columns do not have a property ‘float’ and also cellsformat ‘F2’ is not valid it should be ‘f2’. The type should be set to the datafields definitions in the source object’s initialization.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data Display in Grid Problem #9792

    Tone
    Member

    You couldn’t be more right Peter, I am shamed i didn’t see that before.
    put the type in the initialization and voila the ‘c2’ works perfectly.

    I used your Theme Buider and it works great, thank you for that.
    It is a super tool and the Theme loaded right up perfectly.

    I think my display problems are almost all sorted out now, and EVERY one has been my fault, not a shortcoming of the widget set.

    Thank you for you attention, and i hope to be a licensed developer shortly.

    Tone

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

You must be logged in to reply to this topic.