jQWidgets Forums

jQuery UI Widgets Forums Grid ‘dataAdapter’: object is null or undefined

Tagged: 

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • rjlewis71
    Member

    Good morning!

    I copied the demos->jqxgrid->bindingtojsonp.htm and modified it for my data but I’m getting the ‘dataAdapter’: object is null or undefined error at runtime.  I’m using Visual Studio 2010 and C# to create the JSON object.  I checked the JSON results (using http://jsonlint.com/) and it checks out.  Here is my page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1"><title>
    	NGIL 715-1 Administration
    </title><link href="../../../Includes/css/jqx.base.css" rel="stylesheet" type="text/css" />
        <script src="../../../Includes/js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxcore.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxdata.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxbuttons.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxscrollbar.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxmenu.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.selection.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.columnsresize.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.filter.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.edit.js" type="text/javascript"></script>
        <script src="../../../Includes/jqxwidgets/jqxgrid.sort.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var theme = '';
    
                // prepare the data
                var source =
                {
                    datatype: "jsonp",
                    datafields: [
                        { name: 'DOC_NBR' },
                        { name: 'FROM_USER' },
                        { name: 'STATUS' },
                        { name: 'DATE_RECEIVED' },
                        { name: 'DATE_FUNDED' },
                        { name: 'MERCH_RCVD_DATE' },
                        { name: 'REASON_DELAYED' },
                        { name: 'CARD_HOLDER' },
                        { name: 'PURCHASE_DESC' },
                        { name: 'PURCHASE_AMT' },
                        { name: 'REQ_DELIVERY_DATE' },
                        { name: 'VENDOR_NAME' },
                        { name: 'SAG' },
                        { name: 'RNUM' }
                    ],
                    url: "logajax.aspx?id=ngil715",
                    data: {
                        featureClass: "P",
                        style: "full",
                        maxRows: 50
                    }
                };
    
                var dataAdapter = new $.jqx.dataAdapter(source);
    
                $("#jqxgrid").jqxGrid(
                {
                    width: 670,
                    source: dataAdapter,
                    theme: theme,
                    columnsresize: true,
                    columns: [
                        { text: 'DOC_NBR', datafield: 'DOC_NBR', width: 200 },
                        { text: 'FROM_USER', datafield: 'FROM_USER', width: 200 },
                        { text: 'STATUS', datafield: 'STATUS', width: 200 },
                        { text: 'DATE_RECEIVED', datafield: 'DATE_RECEIVED', width: 200 },
                        { text: 'DATE_FUNDED', datafield: 'DATE_FUNDED', width: 200 },
                        { text: 'MERCH_RCVD_DATE', datafield: 'MERCH_RCVD_DATE', width: 200 },
                        { text: 'REASON_DELAYED', datafield: 'REASON_DELAYED', width: 200 },
                        { text: 'CARD_HOLDER', datafield: 'CARD_HOLDER', width: 200 },
                        { text: 'PURCHASE_DESC', datafield: 'PURCHASE_DESC', width: 200 },
                        { text: 'PURCHASE_AMT', datafield: 'PURCHASE_AMT', width: 200 },
                        { text: 'REQ_DELIVERY_DATE', datafield: 'REQ_DELIVERY_DATE', width: 200 },
                        { text: 'VENDOR_NAME', datafield: 'VENDOR_NAME', width: 200 },
                        { text: 'SAG', datafield: 'SAG', width: 200 },
                        { text: 'RNUM', datafield: 'RNUM', width: 200 }
                    ]
                });
            });
        </script>
    
    </head>
    <body>
        <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
            <div id="jqxgrid"></div>
        </div>
    </body>
    </html>
    I searched the forum before posting....Any ideas?
    
    Robert

    Peter Stoev
    Keymaster

    Hi rjlewis71.,

    jqxDataAdapter is implemented in jqxdata.js i.e that issue can happen only if the path to the jqxdata.js file is not correct.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    rjlewis71
    Member

    Right, and I got that problem fixed. I updated the question, but don’t see that on the post above. Anyway, now I get no errors, but also don’t see a grid.

    Robert

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

You must be logged in to reply to this topic.