I need to call bootstrap modal inside below method. It uses jstree and implemented platfrom is Ionic 3. It fires this error “TypeError: WEBPACK_IMPORTED_MODULE_2_jquery (…).modal is not a function” when modal method is called. Please do help me to find a solution for the error.
loadTreeContent() :void{
var d01_base_url = 'http://localhost/git/mechmar-folder-structure/';
var d01_loading_url = 'index.php/documents/handle_cus_doc_tree';
var d01_base_folder_path = 'customer_docs/71';
var d01_doc_item = '71';
$(function () {
$('#d01-documents').jstree({
"core": {
"multiple": true, //No multi select
"themes": {
"variant": "large",
"responsive": true,
'stripes': true
},
"animation": 500,
'data': {
'url': d01_base_url + d01_loading_url,
'dataType': 'json',
'data': function (node) { //Getting data
if (node.original == undefined)
return {
'id': node.id,
'level': 0,
'operation': 'get_node',
'base_folder_path': d01_base_folder_path,
'doc_tree': d01_doc_item
};
else {
var l = node.original;
return {
'id': node.id,
'level': node.original.level,
'operation': 'get_node',
'base_folder_path': d01_base_folder_path,
'doc_tree': d01_doc_item
};
}
}
},
'check_callback': function (operation, node, node_parent, node_position, more) {
if (more && more.dnd && more.pos !== 'i') {
return false;
}
if (operation === "move_node" || operation === "copy_node") {
if (this.get_node(node).parent === this.get_node(node_parent).id) {
return false;
}
}
if (node_parent.type != 'default') { //Unless dropping to a folder
return false;
}
if (node.original.permissions.edit != 1) { //Check source's edit permissions before moving
//data.instance.refresh();
return false;
}
return true;
},
},
'types': {
'file': { 'icon': d01_base_url + 'assets/img/file-16.png' }
},
"plugins": ["search", "sort", "dnd", "types"]
}).on('changed.jstree', function (e, data) { //Selection changed
// d04_load_document_command_model(data.node, 'd01-documents', d01_loading_url, d01_base_folder_path, d01_doc_item);
// var data = { msg: "asas" };
// var folderModal = this.modalCtrl.create(GeneralDocFolderPage, data);
// folderModal.present();
}).on('move_node.jstree', function (e, data) {
$.get(d01_base_url + d01_loading_url, {
'id': data.node.id,
'drop_folder': data.parent,
'operation': 'move_node',
'base_folder_path': d01_base_folder_path,
'doc_tree': d01_doc_item,
'drag_parent': data.old_parent
}).done(function (d) {
if (d.status == 'failed') {
//alert('Sorry! You cannot move this folder/file. Because it will affect the permissions of other permission groups. So you must change them before this movement.');
alert(d.msg);
} else if (d.status == 'success') {
alert('Success!\nDebug msg:\n\n' + d.msg);
}
data.instance.refresh();
$("#d01-documents").jstree("open_all");
}).fail(function () {
alert('Sorry! Movement process failed, unexpectedly.');
data.instance.refresh();
$("#d01-documents").jstree("open_all");
});
}).on('ready.jstree', function () {
$("#d01-documents").jstree("open_all");
});
}); //Function