jQWidgets Forums

jQuery UI Widgets Forums Grid shows error $.jqx is undefined

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • shows error $.jqx is undefined #6095

    Neelam
    Member

    Hello,

    I am using jqxgrid binding with json using php. it show me error $.jqx is undefined. I am calling grid using ajax call.

    Please tell me what could be the possibilities.

    Thanks,
    Neelam

    shows error $.jqx is undefined #6098

    Peter Stoev
    Keymaster

    Hi Neelam,

    I suggest you to check whether all javascript files are included correctly in your project and you don’t try to call a method or set a property of something which is still not loaded.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    shows error $.jqx is undefined #6100

    Neelam
    Member

    Hello,

    I tried a dummy setup for grid which is working. with below code. same code I am using to replace a div with grid using ajax call but its not working.

    headLink()->appendStylesheet($this->baseUrl().’/scripts/jqwidgets/styles/jqx.base.css’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jquery-1.7.2.min.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxcore.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxbuttons.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxscrollbar.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxmenu.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxcheckbox.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxlistbox.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxdropdownlist.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxgrid.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxgrid.selection.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxgrid.columnsresize.js’) ?>
    headScript()->appendFile($this->baseUrl().’/scripts/jqwidgets/jqxdata.js’) ?>

    $(document).ready(function () {

    var url = SITEDOMAIN+”/dashboards/data”;
    var parentsLength = $(“#jqxWidget”).parents().length;
    if (parentsLength > 3) {
    url = SITEDOMAIN+”/dashboards/data”;
    }
    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘mth’ },
    { name: ‘total’, type: ‘int’ }
    ],
    id: ‘id’,
    url: url,
    root: ‘data’
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $(“#jqxgrid”).jqxGrid(
    {
    width: 670,
    source: dataAdapter,
    columnsresize: true,
    columns: [
    { text: ‘First Name’, dataField: ‘mth’, width: 100 },
    { text: ‘Total’, dataField: ‘total’, cellsalign: ‘right’, minwidth: 100, cellsformat: ‘c2’ }
    ]
    });
    });

    Thanks,
    Neelam

    shows error $.jqx is undefined #6101

    Peter Stoev
    Keymaster

    May be you should append dynamically your document.ready call, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.