Modify Tables or Plots - Remove JavaScript from Selected Tables and Plots
Jump to navigation
Jump to search
Q Technical Reference
Q Technical Reference
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > Automation Online Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library > QScript Online Library
This QScript removes Table or Plot JavaScript from selected items in the Report.
Technical Details
This QScript only works in version of Q prior to Q 4.8. In more recent versions, you should use the Automation tab to remove custom Table JavaScript rules instead of using this script. The method to do so is:
- Select your tables and charts.
- Select Automations.
- Select the custom Table JavaScript rule from the list.
- Select Delete Rule.
How to apply this QScript
- Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
- Click on the QScript when it appears in the QScripts and Rules section of the search results.
OR
- Select Automate > Browse Online Library.
- Select this QScript from the list.
Customizing the QScript
This QScript is written in JavaScript and can be customized by copying and modifying the JavaScript.
Customizing QScripts in Q4.11 and more recent versions
- Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
- Hover your mouse over the QScript when it appears in the QScripts and Rules section of the search results.
- Press Edit a Copy (bottom-left corner of the preview).
- Modify the JavaScript (see QScripts for more detail on this).
- Either:
- Run the QScript, by pressing the blue triangle button.
- Save the QScript and run it at a later time, using Automate > Run QScript (Macro) from File.
Customizing QScripts in older versions
JavaScript
includeWeb('QScript Table Functions');
includeWeb('QScript Selection Functions');
includeWeb("QScript Functions to Generate Outputs");
if (fileFormatVersion() > 8.12)
log('This script only applied for Q versions lower than 4.8. To remove a custom Table JavaScript automation, you should:\r\n'
+ '1. Select your tables and plots.\r\n'
+ '2. Select Automations.\r\n'
+ '3. Select the custom Table JavaScript rule from the list.\r\n'
+ '4. Select Delete Rule.');
else {
// Selection of tables and plots
var tables_plots = selectManyTablesAndPlotsWithGroupNamesAndTypes("Please select the tables and plots that you wish to remove JavaScript from: ", project.report).items;
var num_items = tables_plots.length;
for (var j = 0; j < num_items; j++) {
var cur_item = tables_plots[j];
var cur_java = cur_item.tableJavaScript;
if (cur_java != null) {
cur_java = "// Table or Plot JavaScript Removed by QScript: 'Modifying Tables or Plots - Remove JavaScript From Selected Tables and Plots'";
cur_item.tableJavaScript = cur_java;
}
}
conditionallyEmptyLog("QScript finished.");
}
See also
- QScript for more general information about QScripts.
- QScript Examples Library for other examples.
- Online JavaScript Libraries for the libraries of functions that can be used when writing QScripts.
- QScript Reference for information about how QScript can manipulate the different elements of a project.
- JavaScript for information about the JavaScript programming language.
- Table JavaScript and Plot JavaScript for tools for using JavaScript to modify the appearance of tables and charts.
Q Technical Reference
Q Technical Reference
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > Automation Online Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library > QScript Online Library