У меня возникли проблемы с получением данных JQuery DataTables. Я смотрю в разных местах и просто не могу понять.
Ошибка я получаю с помощью инструментов разработчика Chrome является:
$ (...) DataTable не является функцией
app.js:.
requirejs.config({
"baseUrl": "../Scripts",
"paths": {
app: "./app",
essentials: "./dist/essentials.min",
jquery: "./dist/jquery-1.10.2.min",
"jquery.bootstrap": "./dist/bootstrap.min"
"jquery.dataTables": "./dist/jquery.dataTables.min",
"jquery.dataTables.bootstrap": "./dist/jquery.dataTables.bootstrap.min"
},
"shim": {
"essentials": ["jquery"],
"jquery.dataTables": ["jquery"],
"jquery.dataTables.bootstrap": ["jquery.dataTables"],
"jquery.bootstrap": ["jquery"]
}
});
// Load the main app module to start the app
requirejs(["app/main"]);
main.js (не используется):
require(["jquery"], function ($) {
$(function() {
});
});
Create.js (Сформированный из машинописи):
define(["require", "exports", "../../Shared/ModalHelper"], function (require, exports, Helper) {
require(["jquery", "essentials", "jquery.bootstrap", "jquery.dataTables", "jquery.dataTables.bootstrap"], function ($) {
function initilializeTables() {
var attrSelectDataTable = $('#selectAttrsTable').DataTable({
paging: true,
bInfo: true,
"columnDefs": [
{ "orderable": false, "targets": 0 }
],
scrollY: 400
});
var attrPreviewDataTable = $('#selectedAttrsTable').DataTable({
paging: true,
bInfo: true,
"columnDefs": [
{ "orderable": false, "targets": 0 },
{ "orderable": false, "targets": 5 }
],
scrollY: 400
});
}
initilializeTables();
});
});