DistributorConferences = function( options ) { this.listOptions = $.extend( true, { baseFilter : [] }, options ); this.rootElement = null; this.dataGrid = null; this.data = options; this.filterPreferences = {}; this.initialSearchParams = {}; this.searchParams = $.extend( true, {}, this.initialSearchParams ); this.dataVisible = false; //this.perspective = "operator"; this.keywordTextBox = null; this.keywordCompanyNameOnlyCheckBox = null; this.keywordFilter = []; this.updatingState = false; this.stateKey = this.listOptions.stateKey; //this.operatorFormsPromise= $.Deferred(); //this.operatorForms = []; this.dataURL = $("link#appDataURL").attr( "href" ); this.onReturn = null; let instance = this; } DistributorConferences.prototype.constructor = DistributorConferences; DistributorConferences.prototype.element = function() { if( this.rootElement ) { return this.rootElement; } this.keywordFilter = []; this.rootElement = $("
").addClass( "DistributorConferences" ); //this.loadOperatorForms(); //this.createBreadcrumbs(); this.createToolbar(); let instance = this; instance.ConferencePerspectiveIndex = 0; instance.multiView = $("
").dxMultiView( { swipeEnabled : false, items : [ { perspective : "conferenceList", title : "Distributor Conferences", template : function( itemData, itemIndex, itemContainer ) { itemData.dataGrid = instance.createConferencePerspectiveDataGrid(); instance.dataGrid = itemData.dataGrid; instance.perspective = itemData.perspective; itemContainer.append( itemData.dataGrid.element() ); if( itemData.initialDataGridState ) { instance._applyDataGridState( itemData.dataGrid, itemData.initialDataGridState ); delete itemData.initialDataGridState; } itemData.dataGrid.on( "optionChanged", function( e ) { let propertyName = e.fullName.replace( /\d+/, 'n' ) let saveState = false; switch ( propertyName ) { case 'columns[n].filterValues': case 'columns[n].visible': case 'columns[n].visibleIndex': case 'columns[n].sortOrder': case 'dataSource' : saveState = true; break; } if( saveState ) { instance.saveState(); } else { } } ) } }, ], selectedIndex : instance.ConferencePerspectiveIndex, onSelectionChanged : function( e ) { let selectedItem = e.component.option( "selectedItem" ); if( selectedItem.dataGrid ) { instance.perspective = selectedItem.perspective; instance.dataGrid = selectedItem.dataGrid; if( instance.searchTimestamp != selectedItem.searchTimestamp ) { instance.applyFilters(); } } } }).dxMultiView( "instance" ); instance.rootElement.append( instance.multiView.element() ); // this.createDataGrid(); instance.createFooterToolbar(); instance.loadState().done( function( loadedState ) { instance.setState( loadedState ); instance.applyFilters(); }) return this.rootElement; } DistributorConferences.prototype.setKeywordFilter = function( keyword, searchAll ) { if( ! keyword ) { this.keywordFilter = []; return; } let keywords = []; let allKeywords = ( keyword ? keyword : "" ).replace( /,/g, ' ' ).replace( /\s\s*/g, ' ' ).split( " " ); let keywordFilter = []; let addressFilter = []; if( allKeywords.length >= 3 ) { let nonAddressKeywords = []; let addressKeywords = []; let indexOf = function( a, v ) { return a.findIndex( function( fv, fi, fa ) { return fv.toUpperCase() == v.toUpperCase() }) } let inx= indexOf( allKeywords, "In" ); if( inx != -1 ) { for( let kx = 0; kx < allKeywords.length; kx++ ) { if( kx < inx ) { keywords.push( allKeywords[kx] ) } else if( kx > inx ) { addressKeywords.push( allKeywords[kx]) } } } else { keywords = allKeywords } } else { keywords = allKeywords; } keywords.forEach( function( kw ) { if( keywordFilter.length ) { keywordFilter.push( "and" ); } keywordFilter.push( [ "companyName", "contains", kw ] ) }) if( searchAll ) { keywordFilter = [ keywordFilter ]; if( addressFilter.length == 0 ) { keywordFilter.push( "or", [ "address", "contains", keyword ], "or", ["city", "contains", keyword ], "or", ["state", "=", keyword ], "or", ["zipCode", "=", keyword ] ); } keywordFilter.push( "or", ["recordSource", "contains", keyword ], "or", ["comments", "contains", keyword ] ); } if( addressFilter.length ) { keywordFilter = [ keywordFilter]; keywordFilter.push( "and", addressFilter ); } this.keywordFilter = keywordFilter; } DistributorConferences.prototype.getAllFilters = function() { let allFilters = [this.listOptions.baseFilter ]; let searchFilters = this.buildSearchFilters( this.searchParams ); if( searchFilters.length ) { allFilters.push( "and" ); allFilters.push( searchFilters ); } if( this.keywordFilter.length ) { allFilters.push( "and" ); allFilters.push( [ this.keywordFilter ] ); } return allFilters; } DistributorConferences.prototype.applyFilters = function() { let instance = this; let currentFilters = instance.getAllFilters(); let keyField = null; let additionalFields = ["ccLocalManager","ccDivisionManager","emailRecipients,surveyId,partnerId,partnerType"]; let selectedFields = [] for( let cx = 0; cx < this.dataGrid.columnCount(); cx++ ) { if( this.dataGrid.columnOption( cx, "visible" )) { let dataField = this.dataGrid.columnOption( cx, "dataField" ); if( dataField ) { selectedFields.push( dataField ); } // add in another columns necessary let dataFields = this.dataGrid.columnOption( cx, "fseDataFields" ); if( dataFields ) { if( !Array.isArray( dataFields )) { dataFields = dataFields.split( "," ); } dataFields.forEach( function( df ) { selectedFields.push( df ); }) } } } if( keyField ) { let addKey = true; for( let x = 0; x > selectedFields.length; x++ ) { if( selectedFields[x] == keyField ) { addKey = false; break; } } if( addKey ) { selectedFields.push( keyField ); } } additionalFields.forEach( function( af ) { let addField = true; for( let x = 0; x > selectedFields.length; x++ ) { if( selectedFields[x] == af ) { addField = false; break; } } if( addField ) { selectedFields.push( af ); } }) selectedFields.push("startTime","startTimePeriod","apptDurationMinutes"); let searchFilter = [ [ "partnerId", "=", instance.data.partnerId ] ]; let dataSourceConfig = { customStore : { dataURL : instance.dataURL, object : "CDR.conferenceList", key : keyField }, paginate : true, pageSize : 50, select : selectedFields, filter : searchFilter }; //instance.objectParams = dataSourceConfig.customStore.objectParams; let dataSource = Fse.Data.createDataSource( dataSourceConfig ); dataSource.on( "loadingChanged", function( isLoading ) { if( ! isLoading ) { //loadPanel.hide(); instance.updateRecordCountDisplay( dataSource.totalCount() ); } else { //loadPanel.show(); } }); this.dataGrid.option( "dataSource", dataSource ); //this.updateBreadcrumbs(); this.multiView.option("selectedItem").searchTimestamp = this.searchTimestamp; this.dataVisible = true; this.saveState(); } DistributorConferences.prototype.mergeFilterPreferences = function( searchParamsIn ) { let instance = this; let searchParams = $.extend( true, {}, searchParamsIn ); // when the global filters are expressed with different variable names, they need to translated to this widgets variable names const preferencableFilters = { // widgetVariableName : "globalFilterVariableName" territoryPath : "territoryPath", salesRepId : "salesRepId", segmentPath : "clientSegPath" } for( let p in preferencableFilters ) { let gp = p; // global filter param is the same name as widget param // apply translation - global filter param is not the same name as widget param if( preferencableFilters[p] ) { gp = preferencableFilters[p]; } // if the global filter preferences have the propery and it has a value, update the objectparams if( instance.filterPreferences.hasOwnProperty( gp ) && instance.filterPreferences[gp]) { if( searchParams[p] == null ) { searchParams[p] = instance.filterPreferences[gp]; } } } return searchParams; } DistributorConferences.prototype.buildSearchFilters = function( searchParamsIn ) { let filters = []; let searchParams = this.mergeFilterPreferences( searchParamsIn ); // scrum 46030 for( p in searchParams ) { if( p == "territoryPath" && this.perspective == "territory" ) { continue; } if( p == "salesRepId" && this.perspective == "salesRepId" ) { continue; } if( searchParams[p] ) { let filter = null; let v = null; let op = "="; switch ( p ) { case "productStatusPurchasingStatus" : case "productStatusSourceCompetitorId" : case "productStatusNoSaleReasonId" : case "productStatusSourceOther" : case "productStatusProductHierarchyPath" : // these are handled as objectparams in applyFilters break; case "opportunityEffectiveRepId" : case "stageId" : case "interactionPurposeId" : case "operatorListId" : case "flexFields" : // these are handled as objectparams in applyFilters break; case "excludeMemberGroupId" : // these are handled as objectparams in applyFilters break; case "includeSubTerritories" : // handled with territoryPath break; case "territoryPath" : case "broker_id" : case "segmentPath" : case "salesRepId" : case "classificationId" : case "cuisineId" : case "priority" : case "seasonal" : case "profileComplete" : op = "="; if( p == "territoryPath" || p == "cdr_dstPath" || p == "segmentPath") { op = "startswith"; } if( p == "territoryPath" && ! searchParams.includeSubTerritories ) { op = "="; } v = searchParams[p]; if( Array.isArray( v )) { } else { if( typeof v === "string" ) { v = v.split( "," ); } else { v = [v]; } } filter = []; v.forEach( function( ve ) { if( filter.length ) { filter.push( "or" ); } filter.push( [ p, op, ve ] ); }) break; case "operatorSelectionStatus" : { v = searchParams[p]; if( v == "SELECTED" ) { filter = [[ "selectedOperator", "=", 1 ]]; } else { filter = [[ "selectedOperator", "=", 0 ]]; } } break; case "parentOperatorId" : op = "="; if( p == "territoryPath" || p == "cdr_dstPath" || p == "segmentPath") { op = "startswith"; } v = searchParams[p]; if( Array.isArray( v )) { } else { if( typeof v === "string" ) { v = v.split( "," ); } else { v = [v]; } } searchFields = [ "eventId", "parentOperatorId" ]; filter = []; v.forEach( function( ve ) { if( filter.length ) { filter.push( "or" ); } for( let sfx = 0; sfx < searchFields.length; sfx++ ) { if( sfx != 0 ) { filter.push( "or" ) } filter.push( [ searchFields[sfx], op, ve ] ); } }) break; case "lastInteractionRange" : v = searchParams[p]; filter = []; if( v == "NEVER" ) { filter.push( "noInteractions", "=", 1 ); } else { let days = v * 1; // make it a number let op = "<="; if( days < 0 ) { // not in n days days = days * -1; op = ">" } else { // within n days } filter.push( [ "lastInteractionDays", op, days ] ); } break; case "numUnitsRange" : v = searchParams[p]; filter = []; if( v ) { let rangeValues = v.split( "-" ); let rangeMin = rangeValues[0]; let rangeMax = -1; if( rangeValues.length == 2 ) { rangeMax = rangeValues[1]; } filter.push( [ "isChainHQ", "=", 1 ], "and" ); filter.push( [ "numUnits", ">=", rangeMin ]) if( rangeMax > 0 ) { filter.push( "and" ); filter.push( [ "numUnits", "<=", rangeMax ]) } } break; case "cdr_dstPath" : op = "startswith"; v = searchParams[p]; if( Array.isArray( v )) { } else { if( typeof v === "string" ) { v = v.split( "," ); } else { v = [v]; } } filter = []; v.forEach( function( ve ) { if( filter.length ) { filter.push( "or" ); } filter.push( [ "distrib1_cdr_dstPath", op, ve ], "or", [ "distrib2_cdr_dstPath", op, ve ] ); }) break; case "chainHQsOnly" : v = searchParams[p]; filter = []; if( v ) { filter.push( [ "isChainHQ", "=", 1 ] ) } break; case "includeFavoritesOnly" : v = searchParams[p]; filter = []; if( v ) { filter.push( [ "isUserFlagged", "=", 1 ] ) } break; case "includeMyAccountsOnly" : v = searchParams[p]; filter = []; if( v ) { filter.push( [ "salesRepId", "=", Fse.Portal.appConfiguration.STP.userId ] ) } break; case "assigned" : { v = searchParams[p]; filter = [ "assigned", "=", v ]; } break; case "buyerLocationsOnly" : v = searchParams[p]; filter = []; if( v ) { filter.push( [ "buyingDecisions", "=", "Y" ] ) } break; case "cmcId" : case "gpoId" : op = "="; let memberGroupIdField = "gpoId"; if( p === "cmcId" ) { memberGroupIdField = "cmcId"; } v = searchParams[ p ]; // there are 3 member group fields to search if( ! Array.isArray( v ) ) { if( typeof v === "string" ) { v = v.split( "," ); } else { v = [v]; } } filter = []; v.forEach( function( ve ) { let memberGroupFilter = [ [`${memberGroupIdField}_1`, op, ve], "or", [`${memberGroupIdField}_2`, op, ve], "or", [`${memberGroupIdField}_3`, op, ve], ] if( filter.length ) { filter.push( "or" ) } filter.push( memberGroupFilter ); }) break; } if( filter ) { if( filters.length ) { filters.push( "and" ); } filters.push( filter ); } } } return filters; } DistributorConferences.prototype.createConferencePerspectiveDataGrid = function() { let instance = this; let dataGridConfig = { height : 600, showBorders : true, filterRow : { visible : true }, headerFilter : { visible : true }, scrolling : { mode : "virtual" }, rowAlternationEnabled : true, dataSource : null, allowColumnResizing : true, columnResizeMode : "nextColumn", columns : this.conferencePerspectiveDataGridColumns(), /* columns : [ { dataField : "eventId", visible : true }, ], */ remoteOperations : { filtering : true, paging : true, sorting : true }, onSelectionChanged : function( e ) { if( ! instance.manager ) { return; } let conferenceData = null; if( e.selectedRowsData.length ) { conferenceData = e.selectedRowsData[0]; } instance.manager.onSelectionChanged( conferenceData ) }, onCellClick : function( cce ) { if( cce.rowType != "data" ) { return; } const data = cce.data; if( cce.column.name === "application" ) { let appLocation = $("link#PortalDocRootURL").attr("href") + "/apps/EVT/index.cfm?view=conferenceApp&mode=direct&eventId=" + data.eventId + "&ccLocMgr=" + data.ccLocalManager + "&ccDivMgr=" + data.ccDivisionManager; let appWindow = window.open(); appWindow.location = appLocation; } if( cce.column.name === "edit" ) { let distributorConferenceEditDialog = new DistributorConferenceEditDialog( { //cdr_recordId : instance.data.partnerId, data : data, onReturn : function() { instance.dataGrid.refresh(); }, }); distributorConferenceEditDialog.show(); } if( cce.column.name === "conferenceActions" ) { // create a context menu if( data.eventId ) { let ready = $.Deferred(); let waitingOn = 2; ready.progress( function() { waitingOn = waitingOn - 1; if( waitingOn == 0 ) { ready.resolve(); } }) ready.notify(); ready.notify(); ready.done( function() { let items = [ // { text : "Quick View", actionCode : "quickView" }, //{ text : `Go to '${data.companyName}'`, actionCode : "operatorProfile" }, { text : 'Edit Conference', actionCode : "editConference" } ]; // items for delete items.push( { text : `Delete '${data.eventName}'...`, actionCode : "deleteConference" } ); $("
").dxContextMenu( { items : items, hideOnOutsideClick : true, onHidden : function( cme ) { cme.component.element().remove(); cme.component.dispose(); }, onItemClick : function( cme ) { if( cme.itemData.actionCode ) { switch ( cme.itemData.actionCode ) { case 'editConference' : let distributorConferenceEditDialog = new DistributorConferenceEditDialog( { //cdr_recordId : instance.data.partnerId, //eventId : data.eventId, data : data, onReturn : function() { instance.dataGrid.refresh(); }, }); distributorConferenceEditDialog.show(); break; case 'deleteConference' : { DistributorConferences.prototype.showdeleteConferenceDialog( data, function() { instance.dataGrid.refresh(); } ); } break; } } cme.component.hide(); }, target : cce.cellElement }).appendTo( "body" ).dxContextMenu("show"); }) } } }, onRowDblClick : function( data ) { if( data.rowType != "data" ) { return; } let distributorConferenceEditDialog = new DistributorConferenceEditDialog( { data : data.data, onReturn : function() { instance.dataGrid.refresh(); }, }); distributorConferenceEditDialog.show(); }, } // end datagrid config if( instance.manager ) { dataGridConfig.selection = { mode : "single" } } return $("
").dxDataGrid( dataGridConfig ).dxDataGrid( "instance" ); } DistributorConferences.prototype.createFooterToolbar = function() { let instance = this; instance.recordCountDisplay = $("
"); instance.footerToolbar = $("
").dxToolbar( { items : [ { location : "before", template : function() { return instance.recordCountDisplay; } } ] }).dxToolbar("instance"); instance.rootElement.append( instance.footerToolbar.element() ); } DistributorConferences.prototype.updateRecordCountDisplay = function( recordCount ) { let instance = this; let ds = instance.dataGrid.getDataSource(); let select = ds.select(); let recordCountLabel = 'Records'; select.forEach( function( c ) { if( instance.perspective == "conferenceList" ) { //c == "selectedOperator" || c == "eventId" recordCountLabel = 'Conferences' } }) let recordCountText = DevExpress.localization.formatNumber( recordCount, { type : "fixedPoint", precision : 0 } ) instance.recordCountDisplay.text( `${recordCountText} ${recordCountLabel}`); } DistributorConferences.prototype.createToolbar = function() { let instance = this; let items = []; items.push( { location : "after", widget : "dxButton", options : { icon : "plus", hint : "Add Conference", onClick : function( e ) { let distributorConferenceNewDialog = new DistributorConferenceNewDialog( { cdr_recordId : instance.data.partnerId, onReturn : function() { instance.dataGrid.refresh(); }, }); distributorConferenceNewDialog.show(); } } }), items.push( { location: "after", widget : "dxButton", options : { hint : "Excel Export", icon : "export", onClick : function( e ) { let defaultFileName = "conferenceList.xlsx"; Fse.UI.DataGridHelper.exportDataGrid( { dataGrid : instance.dataGrid, fileName : defaultFileName } ); } } }); // column chooser items.push( { location : "after", widget : "dxButton", options : { hint : "Choose Columns", icon : "columnchooser", onClick : function( ) { if( ! instance.columnChooser ) { instance.columnChooser = new CustomDataGridColumnChooser( instance.dataGrid, function() { instance.applyFilters() } ); } instance.columnChooser.show(); } } }); // help items.push( { widget: "dxButton", location: "after", options : { type : "normal", icon :"help", hint : "View Help", onClick : function( e ) { Fse.Portal.showQuickHelp( "DistributorConferences" ); } }} ); this.toolbar = $("
").dxToolbar( { items : items, /*onContentReady : function( e ) { instance.updateClearAllSelectionsButton(); }*/ }).addClass( "fx-toolbar" ).dxToolbar("instance"); this.rootElement.append( this.toolbar.element().css( { "margin-bottom" : "5px", "margin-top" : "5px" }) ); } DistributorConferences.prototype.conferencePerspectiveDataGridColumns = function() { let instance = this; let columns = []; columns.push( { dataField : "eventId", caption : "eventId", visible : false}, { dataField : "eventIdTk", caption : "eventIdTk", visible : false}, { dataField : "eventName", caption : "Conference Name", visible : true}, { dataField : "startDate", caption : "Start Date", visible : true , width : 150, alignment : "center", }, { dataField : "endDate", caption : "End Date", visible : true , width : 150, alignment : "center", }, { name: "application", caption : "Application", visible : true , width : 100, alignment : "center", cellTemplate: function(container, cellInfo) { const valueDiv = $('
').dxButton({ icon: 'link', }) valueDiv.css({ "vertical-align": "middle", "border" : "none", "background" : "transparent"}); return valueDiv; } }, /* { caption: "Edit", name : "edit", visible : true, showInColumnChooser : false, width : 50, alignment : "center", fseDataFields : [ "eventId", "eventIdTk" ], cellTemplate: function(container, cellInfo) { const valueDiv = $('
').text("Edit"); valueDiv.css({ "vertical-align": "middle", "border" : "none", "background" : "transparent"}); return valueDiv; } }, */ { caption: "Export", name : "conferenceExport", visible : true, showInColumnChooser : false, width : 50, alignment : "center", fseDataFields : [ "eventId", "eventIdTk" ], cellTemplate: function(container, cellInfo) { const valueDiv = $('
').dxButton({ icon: 'report', onClick : function( ) { DistributorConferences.openConferenceSummaryExport( cellInfo.data ); } }) valueDiv.css({ "vertical-align": "middle", "border" : "none", "background" : "transparent"}); return valueDiv; } }, { name : "conferenceActions", visible : true, showInColumnChooser : false, width : 30, fseDataFields : [ "eventId", "eventIdTk" ], type: "buttons", buttons: [{ template: function(data) { let button = $("
").addClass("dx-icon-overflow").css( { "display" : "inline-block", "cursor" : "pointer" }); return button; } }] }, ) columns.forEach( function( c ) { c.allowHeaderFiltering = false; if( c.headerFilter ) { c.allowHeaderFiltering = true; c.allowFiltering = false; } }) return columns; } DistributorConferences.prototype.loadState = function() { let instance = this; let d = $.Deferred(); if( ! instance.stateKey ) { d.resolve( null ); return d; } else { const sURL = $("link#PortalDocRootURL").attr("href") + "/apps/CRM/index.cfm?do=widgetState&mode=direct"; const widgetStateParams = { operation : "GET", itemName : instance.stateKey, itemState : "" } $.post( sURL, $.param( widgetStateParams ), null, "json").done( function( result ) { d.resolve( result ); }); } return d; } DistributorConferences.prototype.getState = function() { let instance = this; let saveState = { searchParams : instance.searchParams, perspective : instance.perspective, dataGridState : {} }; instance.multiView.option( "items" ).forEach( function( multiViewItem ) { if( multiViewItem.dataGrid ) { saveState.dataGridState[multiViewItem.perspective] = Fse.UI.DataGridHelper.getState( multiViewItem.dataGrid ); } else if( multiViewItem.initialDataGridState ) { saveState.dataGridState[multiViewItem.perspective] = multiViewItem.initialDataGridState; } } ) return saveState; } DistributorConferences.prototype.setState = function( loadedState ) { let instance = this; if( loadedState && loadedState.searchParams && loadedState.dataGridState ) { instance.updatingState = true; instance.searchParams = $.extend( true, {}, instance.initialSearchParams, loadedState.searchParams ); instance.multiView.option( "items" ).forEach( function( multiViewItem ) { let loadedDataGridState = loadedState.dataGridState[multiViewItem.perspective]; if( loadedDataGridState ) { if( multiViewItem.dataGrid ) { instance._applyDataGridState( multiViewItem.dataGrid, loadedDataGridState ); } else { multiViewItem.initialDataGridState = loadedDataGridState; } } }) instance.updatingState = false; if( instance.perspective != loadedState.perspective ) { switch ( loadedState.perspective ) { case "operator" : instance.showOperatorPerspective(); break; case "contact" : instance.showContactPerspective(); break; case "territory" : instance.showTerritoryPerspective(); break; case "salesRep" : instance.showSalesRepPerspective(); break; } } } else { //console.log( "NO STATE TO LOAD" ); } } DistributorConferences.prototype._applyDataGridState = function( dataGrid, state ) { dataGrid.beginUpdate(); Fse.UI.DataGridHelper.setState( dataGrid, state ); if( Array.isArray( state.columns )) { for( let cx = 0; cx < state.columns.length; cx++ ) { const co = { visibleIndex : state.columns[cx].visibleIndex, visible : state.columns[cx].visible } dataGrid.columnOption( cx, co ) } } dataGrid.endUpdate(); } DistributorConferences.prototype.saveState = function() { let instance = this; if( ! instance.stateKey || instance.updatingState ) { return; } setTimeout( function() { const state = instance.getState(); const saveStateParams = { operation : "SET", itemName: instance.stateKey, itemState : JSON.stringify( state ) }; const sURL = $("link#PortalDocRootURL").attr("href") + "/apps/CRM/index.cfm?do=widgetState&mode=direct"; $.post( sURL, $.param( saveStateParams ), function() { //console.log( "State Saved: " + saveStateParams.itemName ) //console.log( state ); } ); }, 500 ); } DistributorConferences.openConferenceSummaryExport = function( currentEvent ){ Fse.Portal.showReportCenter( { applicationCode : "EVT", reportCode : "EventConferenceSummary", rpt_eventId : currentEvent.eventId, params : { rpt_eventId : currentEvent.eventId, rpt_eventId_opt : currentEvent.eventId, } }) //console.log(currentEvent); /* let pdfURL = Fse.Util.updateURL2( DistributorPortfolio.getHandler(), { rpt_eventId : currentEvent.eventId, ajax : "reportCenter", rc_report : "EventConferenceSummary", rc_format : "xls" }) Fse.Portal.showReportCenter(pdfURL ) ; */ } DistributorConferences.prototype.showdeleteConferenceDialog = function( data, onSuccess ){ let actionButton = null; let popup = null; let deleteForm = null; cancelButton = $("
").dxButton( { text : "Cancel", type : "default", onClick : function( e ) { popup.hide(); } }).dxButton( "instance" ); actionButton = $("
").dxButton( { text : "Delete", type : "default", onClick : function( e ) { let dataToSend = deleteForm.option( "formData" ); Fse.Ajax.performAction( { object : "CDR.deleteConference", data : dataToSend }).done( function( deleteConferenceResult ) { if( deleteConferenceResult.status == "success" && onSuccess ) { onSuccess(); } popup.hide(); }); } }).dxButton( "instance" ); popup = $("
").dxPopup( { title : "Delete Conference", width : 600, height : "auto", hideOnOutsideClick : true, contentTemplate : function( ) { let content = $("
"); content.append( $("

").html( "You are about to DELETE the following conference from the Distributor Porfolio:" )); let conferenceElement = $("

" ).css( { "padding-left" :"10px", "padding-top" : "10px", height : "100px" } ); conferenceElement.append( $("
").text( data.eventName ).css( { "font-weight" : "bold" } )); conferenceElement.append( $("
").text( `${data.startDate} - ${data.endDate}` ) ); //conferenceElement.append( $("
").text( `${distributorData.city}, ${distributorData.state} ${distributorData.zipCode}` )); content.append( conferenceElement ); deleteForm = $("
").dxForm( { formData : { eventId : data.eventId, eventIdTk : data.eventIdTk, }, }).dxForm( "instance" ); return content; }, toolbarItems : [ { toolbar : "bottom", location : "after", template : function() { return actionButton.element(); } } ], onHidden : function( e ) { e.component.element().remove(); e.component.dispose(); } }).appendTo( "body" ).dxPopup("instance"); popup.show(); }