Server IP : 85.193.89.191 / Your IP : 3.22.61.41 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bitrix/www/bitrix/components/bitrix/iblock.property.grid/templates/.default/ |
Upload File : |
import {Reflection, Loc} from 'main.core'; class PropertyListGrid { #gridId: String; #sliderSettings: Object; static Instance: PropertyListGrid = null; constructor(options) { this.#gridId = options.id; this.#sliderSettings = { width: 900, cacheable: false, allowChangeHistory: false, events: { onClose: () => { this.#getGrid().reload(); }, }, }; } #getGrid() { if (this.#gridId) { const grid = BX.Main.gridManager.getInstanceById(this.#gridId); if (grid) { return grid; } } throw new Error(`Not found grid for property list with id ${this.#gridId}`); } openDetailSlider(id) { top.BX.SidePanel.Instance.open(`details/${parseInt(id)}/`, this.#sliderSettings); } openCreateSlider() { top.BX.SidePanel.Instance.open('details/0/', this.#sliderSettings); } static openCreateSliderStatic() { PropertyListGrid.Instance.openCreateSlider(); } delete(id) { BX.UI.Dialogs.MessageBox.confirm( Loc.getMessage('IBLOCK_PROPERTY_LIST_TEMPLATE_CONFIRM_DELETE'), () => { // emulate run group action `delete` const grid = this.#getGrid(); const data = { 'ID': [ id, ], }; data[grid.getActionKey()] = 'delete'; grid.reloadTable('POST', data); return true; }, ); } } Reflection.namespace('BX.Iblock').PropertyListGrid = PropertyListGrid;