jQWidgets Forums

jQuery UI Widgets Forums Grid n.global is undefined

This topic contains 1 reply, has 1 voice, and was last updated by  dpdragnev 12 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • n.global is undefined #10464

    dpdragnev
    Member

    Hi,

    I am just starting up and this is my first attempt to integrate jqWidgets with our MVC 4 application.

    I have followed the example for creating CRUD functionality using .NET (http://www.jqwidgets.com/jquery-widgets-documentation/documentation/asp.net-integration/asp.net-grid-crud.htm). The only difference is that I did not include the scripts directly, but bundled them together using .NET bundling functionality.

    I am at the points that I can display the grid with the data and everything seems to be working well however, when I look at the error console of Firefox I see the “n.global is undefined”.

    Here is my code:

    js——————

    $(document).ready(function () {
    var theme = ‘classic’;
    //set up the data source
    var source = {
    datatype: “json”,
    datafields: [
    { name: ‘UserId’ },
    { name: ‘FirstName’ },
    { name: ‘LastName’ },
    { name: ‘UserName’ },
    { name: ‘Email’ },
    { name: ‘Phone’ },
    { name: ‘Company’ },
    { name: ‘RoleName’ }
    ],
    id: ‘UserId’,
    url: ‘Admin/GetUsers’,

    //set the actions – add and update will redirect, delete will call a method and will refresh the view

    };
    //initialize the grid
    $(“#jqxgrid”).jqxGrid({
    width: 950,
    height: 350,
    source: source,
    theme: theme,
    columns: [
    { text: ‘ID’, datafield: ‘UserId’, width: 50 },
    { text: ‘First Name’, datafield: ‘FirstName’, width: 90 },
    { text: ‘Last Name’, datafield: ‘LastName’, width: 90 },
    { text: ‘Username’, datafield: ‘UserName’, width: 100 },
    { text: ‘E-Mail’, datafield: ‘Email’, width: 200 },
    { text: ‘Phone’, datafield: ‘Phone’, width: 140 },
    { text: ‘Company’, datafield: ‘Company’, width: 150 },
    { text: ‘Role’, datafield: ‘RoleName’, width: 130 },
    ]
    });

    //set the buttons
    //create
    $(“#btnCreate”).jqxButton({ theme: theme });
    $(“#btnCreate”).bind(“click”, function() {
    //redirect to the appropriate action
    });
    });

    Do you see anything that I am doing wrong?

    Thank you,
    Daniel Dragnev

    n.global is undefined #10465

    dpdragnev
    Member

    To add to this question: Is there a difference in which order are the js scripts added? The way I bundled them is taking the whole directory with all scripts (probably in alpha order). Could that be the problem?

    This was it. The bundling mechanism had added all the scripts in alpha order. As soon as I added them in the correct order the error disappeared.

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

You must be logged in to reply to this topic.