Avoid Errors When Defining Resources with the Ignite UI Loader

Craig Shoemaker / Monday, January 21, 2013

When defining resources in the $.ig.loader options, you have the option to explicitly load all the scripts associated with the control itself, load a selection of its features and even a load using a wild card option. When you are loading in explicit features the format of the resources string is very important – the list is comma delimited and spaces are not allowed.

Therefore, when you are loading scripts…

Don’t Do This

$.ig.loader({
    scriptPath: "http://localhost/ig_ui/js/",
    cssPath: "http://localhost/ig_ui/css/",
    resources: "igGrid, igGrid.Paging"
});

Notice how there is a space after the comma where the second resource is loaded. When you try to run this page you’ll get an error that says:

Uncaught Resource ' igGrid' cannot be found. Please check that the resource name is correct.

Do This

$.ig.loader({
    scriptPath: "http://localhost/ig_ui/js/",
    cssPath: "http://localhost/ig_ui/css/",
    resources: "igGrid,igGrid.Paging"
});

Note that the space is now removed and this code now executes as expected.