Created
April 3, 2019 12:44
-
-
Save karpovets/c6093c7921be51d237e34380ab9cc2ee to your computer and use it in GitHub Desktop.
Добавить выпадающее меню в сущность CRM, Битрикс24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wrap = document.getElementById("pagetitle-menu"); | |
var addButtonMore = BX.create("span", { | |
props: {className: "ui-btn-double ui-btn-primary ui-btn-primary_custom"}, | |
children: [ | |
BX.create("button", { | |
props: {className: "ui-btn-main", type: "button"}, | |
html: 'Действия', | |
events: {click: BX.proxy(this.addEntry, this)} | |
}) | |
] | |
}); | |
wrap.appendChild(addButtonMore); | |
var menuItems = [ | |
{ | |
text: 'Отклонить платеж', | |
onclick: 'запуск ф-и' | |
}, | |
{ | |
text: 'Принять платеж', | |
onclick: 'запуск ф-и' | |
}, | |
]; | |
var addButtonExtra = BX.create("span", { | |
props: {className: "ui-btn-extra"}, | |
events: { | |
click: function () { | |
console.log('showPopup'); | |
var popup = BX.PopupMenu.create( | |
'bp_menu', | |
addButtonExtra, | |
menuItems, | |
{ | |
closeByEsc: true, | |
autoHide: true, | |
zIndex: this.zIndex, | |
offsetTop: 0, | |
offsetLeft: 15, | |
angle: true | |
} | |
); | |
popup.show(); | |
} | |
} | |
}); | |
addButtonMore.appendChild(addButtonExtra); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment