").dxPopup( {
title : "Eligible Objectives",
height : 425,
xwidth : 600,
hideOnOutsideClick : false,
contentTemplate : function() {
eligibleObjectivesDataGrid = $("
").dxDataGrid( {
showBorders : true,
scrolling : { mode : "virtual" },
height : 325,
dataSource : Fse.Data.newDataSource( { object : "BOM.eligibleObjectives", keyField : "objectiveId", paginate : false, objectParams : {
operatorId : data.operatorId
}}),
columns : [
{ type : "buttons", width : 30,
name : "viewObjectiveSummary",
buttons : [
{ icon : "info", hint : "View Objective Summary", onClick : function( e ) {
let objectiveId = e.row.data.objectiveId;
let oLink = document.getElementById( "oprHandlerLink" );
let sURL = oLink.getAttribute( "href" ) + "?get=objectiveOverview&objectiveId=" + encodeURIComponent( objectiveId );
let oOptions = {
title : "Objective Overview",
width : "600px",
src : sURL,
namedButtons : "close"
};
Fse.DialogManager.show( "objectiveOverviewDialog$", oOptions );
}}
]
},
{ dataField : "objName", caption : "Objective" },
{ dataField : "targetCount",caption : "Targets", dataType : "number", width : 100,
cellTemplate : function( container, options ) {
if( options.data.linkStatus == "ELIGIBLE" ) {
container.append( options.text );
}
}
},
{ dataField : "quota", caption : "Quota", dataType : "number", width : 100,
cellTemplate : function( container, options ) {
if( options.data.linkStatus == "ELIGIBLE" ) {
container.append( options.text );
}
}
},
{ dataField : "quotaAchieved", caption : "Achievement", dataType : "number", width : 100,
cellTemplate : function( container, options ) {
if( options.data.linkStatus == "ELIGIBLE" ) {
container.append( options.text );
}
}
},
{
caption : "Target",
width : 70,
name : "operatorSelected",
cellTemplate : function( container, options ) {
if( options.data.linkStatus == "ELIGIBLE" ) {
const objectiveId = options.data.objectiveId;
$("
").dxCheckBox({
onValueChanged : function( ee ) {
updateTargeting( objectiveId, ee.value );
}
}).appendTo( container );
}
}
}
]
}).dxDataGrid( "instance" );
return eligibleObjectivesDataGrid.element();
},
onHidden : function( e ) {
eligiblePopup.element().remove();
eligiblePopup.dispose();
},
toolbarItems : [
{
toolbar : "bottom",
location : "after",
template : function() {
return submitButton.element();
}
}
]
}).dxPopup( "instance" );
$("body").append( eligiblePopup.element() );
eligiblePopup.show();
}
linkedObjectivesDataGrid = $("
").dxDataGrid( {
showBorders : true,
scrolling : { mode : "virtual" },
height : 450,
dataSource : Fse.Data.newDataSource( { object : "OPR.operatorObjectives", keyField : "objectiveId", paginate : false, objectParams : {
operatorId : data.operatorId
}}),
columns : [
{ type : "buttons", width : 30,
name : "viewObjectiveSummary",
buttons : [
{ icon : "info", hint : "View Objective Summary", onClick : function( e ) {
let objectiveId = e.row.data.objectiveId;
let oLink = document.getElementById( "oprHandlerLink" );
let sURL = oLink.getAttribute( "href" ) + "?get=objectiveOverview&objectiveId=" + encodeURIComponent( objectiveId );
let oOptions = {
title : "Objective Overview",
width : "600px",
src : sURL,
namedButtons : "close"
};
Fse.DialogManager.show( "objectiveOverviewDialog$", oOptions );
}}
]
},
{ dataField : "objName", caption : "Objective" }
]
}).dxDataGrid( "instance" );
content.append( linkedObjectivesDataGrid.element() );
$("
").dxToolbar( {
items : [
{
location : "after",
widget : "dxButton",
options : {
text : "Add Objectives",
onClick : function( e ) {
addObjectives();
}
}
}
]
}).css( { "margin-top" : "5px", "margin-bottom" : "5px" } ).appendTo( content );
return content;
}
*/