Instantly share code, notes, and snippets.
Last active
October 20, 2016 05:26
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save krisclarkdev/67be088febf1d5bbfda97314e1b5f514 to your computer and use it in GitHub Desktop.
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
WRCustomDialog = actuate.Class.create(); | |
WRCustomDialog.prototype = actuate.Class.extend(new WRCommonBaseDialog(), { | |
isResizable : false, | |
_title : 'Tree Map Dialog', | |
minWidth : 400, | |
minHeight : 200, | |
_defaultWidth : 400, | |
_defaultHeight : 200, | |
initialize : function () { | |
this.hasCancelButton = false; | |
this.__initBase(Constants.PreviewDataSetDialog.dialogId, "400px"); | |
this.ctEl = document.getElementById(Constants.PreviewDataSetDialog.containerId); | |
this._window.registerEventHandler("resize", actuate.Method.bind(this._dialogResize, this)); | |
this._curWidth = this._defaultWidth; | |
this._curHeight = this._defaultHeight; | |
this._dialogResize(100, 500); | |
$('#PreviewDataSetDialogContainer').html('<table><tr><td>X-Axis</td><td><select style="width=75px;"><option value="creditLimit">Credit Limit</option></select></td></tr><tr><td>Y-Axis</td><td><select style="width=75px;"><option value="country">Country</option></select></td></tr></table><form></div>'); | |
$('#previewDataSetDialog').height(100); | |
}, | |
_initButtons : function () { | |
if (!this.hasFooter) { | |
return null; | |
} | |
var _c6b = []; | |
var _c6c = null; | |
var _c6d = null; | |
var _c6e = null; | |
var _c6f = null; | |
var _c70 = this.props["buttonCount"]; | |
_c70 = parseInt(_c70); | |
switch (_c70) { | |
case 1: | |
_c6c = this.props["buttonTxt0"] || Constants.dialog.btnOk; | |
break; | |
case 2: | |
_c6c = this.props["buttonTxt0"] || Constants.dialog.btnOk; | |
_c6d = this.props["buttonTxt1"] || Constants.dialog.btnCancel; | |
break; | |
case 3: | |
break; | |
default: | |
} | |
if (this.hasHelpButton) { | |
this._helpBtn = new actuate.uiadapter.Button({ | |
icon : actuate.getDefaultIportalUrl() + "bizRD/images/dialogHelp.png", | |
iconCls : "helpLinkButtonPosition", | |
cls : "helpLinkButtonPosition", | |
style : "position:absolute;right:0;width:30px;height:auto;border:none;margin:0px;padding:0px;" | |
}); | |
_c6b.push(this._helpBtn.buttonEl); | |
} | |
this._prevBtn = new actuate.uiadapter.Button({ | |
text : "Cancel", | |
style : "position:absolute;left:110px;bottom:18px", | |
btnRounded : "secondary" | |
}); | |
this._nextBtn = new actuate.uiadapter.Button({ | |
text : " Add ", | |
style : "position:absolute;left:15px;bottom:18px", | |
btnRounded : "secondary" | |
}); | |
this._helpBtn = new actuate.uiadapter.Button({ | |
text : "Help", | |
style: "position:absolute;left:275px;bottom:18px", | |
btnRounded : "secondary" | |
}) | |
this._prevBtn.registerEventHandler("click", actuate.Method.bind(this._customDialogMethod2, this), false); | |
this._nextBtn.registerEventHandler("click", actuate.Method.bind(this._customDialogMethod1, this), false); | |
this._helpBtn.registerEventHandler("click", actuate.Method.bind(this._customHelpMethod, this), false); | |
_c6b.push(this._prevBtn); | |
_c6b.push(this._nextBtn); | |
_c6b.push(this._helpBtn); | |
return _c6b; | |
}, | |
_customDialogMethod1 : function () { | |
// ADD SERVLET HERE | |
// ADD SERVLET HERE | |
// ADD SERVLET HERE | |
// ADD SERVLET HERE | |
// CALL BELOW IN AJAX CALLBACK | |
birtEventDispatcher.broadcastEvent(birtEvent.__E_SAVE_FILE); | |
this.__okPress(); | |
}, | |
_customDialogMethod2 : function () { | |
this.__cancelPress(); | |
}, | |
_customHelpDialog : function() { | |
alert('help'); | |
}, | |
__okPress : function () { | |
this._hide(); | |
}, | |
__preHide : function () { | |
this._currentPageNumber = 1; | |
this._datasets = null; | |
}, | |
_dialogResize : function (x, y) { | |
var _c80 = this._window.windowEl.body.getSize(true); | |
this._curWidth = 200; | |
this._curHeight = _c80.height + y; | |
//this._columnsGrid.setSize(this._curWidth, this._curHeight); | |
} | |
}); | |
setTimeout(function () { | |
$('#actuate-gen56').parent().delay(5000).append('<td id="test-gen28" class=" "><table border="0" cellpadding="0" cellspacing="0" class="actuate-widget-btn-wrap actuate-widget-btn actuate-widgetex-menubar-btn " id="_test_wrmenubar_fileMenu" style="width: auto;"><tbody><tr><td class="actuate-widget-btn-left"><i> </i></td><td class="actuate-widget-btn-center"><em unselectable="on"><button class="actuate-widget-btn-text" type="button" id="customStudioButton1">Custom Viz</button></em></td><td class="actuate-widget-btn-right"><i> </i></td></tr></tbody></table></td>'); | |
$('#customStudioButton1').click(function () { | |
new WRCustomDialog().showDialog() | |
}); | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment