Hi, we have this bit of code
viewer used type is viewer: Stimulsoft.Viewer.StiViewer,
viewer.jsObject.postInteractionOld = viewer.jsObject.postInteraction;
viewer.jsObject.postInteraction = (params: PostInterraction) => {
if (params.action == 'InitVars') {
//
}
if (params.action == 'Variables' && AllowApiReportCallback.includes(viewer.report.reportName)) {
///
}
viewer.jsObject.postInteractionOld(params);
};
Problem is it keeps complaining Property 'postInteractionOld' does not exist on type 'StiJsViewer'.ts(2339) Any ideas?
PostInteraction Implementation and override
-
- Posts: 1
- Joined: Tue Mar 08, 2022 3:00 pm
-
- Posts: 7292
- Joined: Tue Mar 20, 2018 5:34 am
Re: PostInteraction Implementation and override
Hello,
You can use the following code:
If it doesn't help you, please send us a sample project.
Thank you.
You can use the following code:
Code: Select all
//viewer.jsObject.postInteractionOld = viewer.jsObject.postInteraction;
const postInteractionOld = viewer.jsObject.postInteraction.bind(viewer.jsObject);
viewer.jsObject.postInteraction = (params: PostInterraction) => {
if (params.action == 'InitVars') {
//
}
if (params.action == 'Variables' && AllowApiReportCallback.includes(viewer.report.reportName)) {
///
}
postInteractionOld(params);
};
Thank you.