HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RMourik/bassol.nl/CMS/CMSScripts/CMSModules/CMS.EventManager/EventsGrid.js
cmsdefine(['CMS/EventHub', 'CMS/AppList', 'CMS/GridActions'], function (eventHub, AppList, GridActions) {

    var appList = new AppList(),

        EventsGrid = function (data) {
            var that = this,
                gridActions;

            this.pagesApplicationHash = data.pagesApplicationHash;
            this.eventDetailUrl = data.eventDetailURL;

            gridActions = new GridActions({
                gridSelector: data.gridSelector,
                actionButtonsActions: {
                    '.js-edit': function (actionData) {
                        that.openEventInPages(actionData.nodeId, actionData.documentCulture);
                    },
                    '.js-view': function(actionData) {
                        that.viewEventDetail(actionData.nodeId);
                    }
                }
            });
        };

    EventsGrid.prototype.openEventInPages = function (documentId, documentCulture) {
        appList.openApplication(undefined, undefined, '?action=edit&nodeid=' + documentId + '&culture=' + documentCulture, this.pagesApplicationHash);
    };

    EventsGrid.prototype.viewEventDetail = function (eventId) {
        if (this.eventDetailUrl) {
            window.location.replace(this.eventDetailUrl + '&eventId=' + eventId + '&objectid=' + eventId);
        }
    };

    return EventsGrid;
});