Почему предупреждение («А») не срабатывает? [дубликат]Javascript

Форум по Javascript
Ответить
Anonymous
 Почему предупреждение («А») не срабатывает? [дубликат]

Сообщение Anonymous »

У меня есть этот js-файл
(function ($) {
app.modals.ClassificationTreeModal = function () {
var selectedId = [];
var _stocktakingSessionsService = abp.services.app.stocktakingSessions;
var _modalManager;
this.init = function (modalManager) {
_modalManager = modalManager;
var modal = _modalManager.getModal();
alert('A');
$(".modal-dialog").removeClass("modal-dialog modal-xl").addClass("modal-dialog modal-xl modal-dialog-scrollable");
$(".content").removeClass("content d-flex flex-column flex-column-fluid").addClass("modal-body");
};

_stocktakingSessionsService.getClassificationTree(
1,
2
).done(function (data) {

var res1 = JSON.parse(data);
$('#jstree').jstree({
core: {
data: res1,
check_callback: true,
"themes": {
"variant": "large"
}
},
"types": {
"default": {
"icon": "fa fa-folder text-primary"
},
"file": {
"icon": "fa fa-folder text-primary"
}
},
'checkbox': {
//keep_selected_style: false,
////whole_node: false,
////tie_selection: true
//three_state: false,
//cascade: 'none'

},
'search': {
'case_insensitive': true,
'show_only_matches': true
},
"plugins": ["search", "wholerow", "checkbox"]

}).on('search.jstree', function (nodes, str, res) {
if (str.nodes.length === 0) {
$('#jstree').jstree(true).hide_all();
}
});

$('#deliverable_search').keyup(function () {

$('#jstree').jstree(true).show_all();
$('#jstree').jstree('search', $(this).val());
});

$('#jstree').on('changed.jstree', function (e, data) {

selectedId = []
for (var i = 0; i < data.selected.length; i++) {
selectedId.push(data.instance.get_node(data.selected).id);
}

});

var inputString = document.getElementById('arrayInput').value;
var nodesToCheck = JSON.parse(inputString);
$('#jstree').on('loaded.jstree', function () {
// Check the node with id '2'

nodesToCheck.forEach(function (nodeId) {

$('#jstree').jstree('check_node', nodeId.toString());
});

})

});

this.save = function () {
var arr = selectedId

var data = {
arr2: selectedId,

};

_modalManager.setResult(data);
abp.event.trigger('app.ClassificationTreeStocktakingSessionModalSaved', data);
abp.notify.info(app.localize('SavedSuccessfully'));
_modalManager.close();

};
}

})(jQuery);

I am trying to make modal scrollable.

I put the alert('A') to test but it is not firing ?

Any reason.


Подробнее здесь: https://stackoverflow.com/questions/798 ... not-firing
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Javascript»