These funcitons are not officially supported by TIBCO and might change from one version to the other. Use of them at your own risk
js
okClick = function(x){alert("mee too!")}
noClick = function(x){alert("too bad")}
xClick = function(x){alert("why cancel?")}
Spotfire.ConfirmDialog.showYesNoCancelDialog("Hello","do you like this",okClick,noClick,xClick)//last two areguments are optional
myDialog=Spotfire.ConfirmDialog.showDialog("hello","there",[])
myDialog.close()
Spotifre.ConfirmDialog methods:
showDialog(title,message,emptyArray?)
showOkDialog(title,message,okCallbackFunction)
showOkCancelDialog(title,message,okFunction,CancelFunction)
showYesNoDialog(title,message,yesFunction,NoFunction,?,?)
showYesNoCancelDialog(title,message,yesFunction,NoFunction,CancelFunction,?)
? are optional unknown arguments
To explore other function, open the console on developer tools and type Spotfire
Here are some more Spotfire API snippets
progress = Spotfire.Progress.createProgressOverlay();
progress.setText("Loading, please wait");
setTimeout(function(){
progress.node().remove();
},3000);
This ones can be useful to detect the user agent:
Spotfire.isWebPlayer
Spotfire.isProfessional
Spotfire.isAuthorMode
Spotfire.isInitialized
Explore the JavaScript Spotfire object properties and methods by searching for keywords
function traversePropertiesAndFunctions(obj, keyword, path = []) {
for (let prop in obj) {
if (obj.hasOwnProperty(prop)) {
const currentPath = [...path, prop];
if (typeof obj[prop] === 'function') {
if (prop.toLowerCase().includes(keyword.toLowerCase())) {
console.log(`Found function: ${currentPath.join('.')}`);
}
} else if (typeof obj[prop] === 'object') {
traversePropertiesAndFunctions(obj[prop], keyword, currentPath);
} else if (typeof obj[prop] === 'string') {
if (prop.toLowerCase().includes(keyword.toLowerCase())) {
console.log(`Found property: ${currentPath.join('.')}`);
}
}
}
}
}
// Example usage
traversePropertiesAndFunctions(Spotfire, 'page');
No comments:
Post a Comment