Test Case - In Development, not sure how to link a JS Fiddle when using a local web server and database.
Debugger - Says no jQuery loaded. jQuery is my first require and it is working else where on the page.
Error - Uncaught Cannot extend unknown button type: create.
Description - I have set up an environment using Typescript, Grunt, and Browserify to make a bundle. Everything has been working great until I tried using the trial version of the editor. I followed the install.js instructions to make sure the right files were moved into my node_modules. I have 11 days left to get the Full CRUD operations and need to get this working before I can get the okay on buying a license.
Code:
// jQuery and BootStrap
let $ = require( 'jquery' );
require('bootstrap');
require('popper.js')
require('bootstrap-select');
// DataTables
let dt = require( 'datatables.net-bs4' )();
let editor = require( 'datatables.net-editor-bs4' )();
require( 'datatables.net-buttons-bs4' )();
require( 'datatables.net-select-bs4' )();
// CSS Imports
import "datatables.net-bs4/css/dataTables.bootstrap4.min.css";
import "datatables.net-editor-bs4/css/editor.bootstrap4.min.css"
import "datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css";
import "datatables.net-select-bs4/css/select.bootstrap4.min.css";
import "bootstrap-select/dist/css/bootstrap-select.min.css";
$(document).ready(function () {
// set up editor
let _editor = new editor({
ajax: "/testpackage/tgroup/params/0/TG",
table: "#tgParamList",
idSrc: "uid",
fields: [{
label: "Name:",
name: "name"
},
{
lable: "Value:",
name: "value"
}
]
});
// Activate an inline edit on click of a table cell
$('#tgParamList').on('click', 'tbody td:not(:first-child)', function (e) {
_editor.inline(this);
});
// Start table
$('#tgParamList').DataTable({
dom: "Bfrtip",
ajax: "/testpackage/tgroup/params/0/TG",
order: [
[1, 'asc']
],
columns: [{
data: null,
className: "checkbox-row",
defaultContent: '<input type="checkbox"/>',
orderable: false
},
{
data: "name"
},
{
data: "value"
}
],
select: {
style: 'os',
selector: 'td:first-child'
},
buttons: [{
extend: "create",
editor: _editor
},
{
extend: "edit",
editor: _editor
},
{
extend: "remove",
editor: _editor
}
]
});
});