Qlik Community

QlikView Documents

Documents for QlikView related information.

Document Extension Solution to hide buttons on the AJAX toolbar...and anything else

Employee
Employee

Document Extension Solution to hide buttons on the AJAX toolbar...and anything else

This past week several QliKTech employees got together for an extensions bootcamp, and this extension is one of the (hopefully) useful extensions that came out of it.  Dave Braune, Alexander Karlsson, and Samuel Pena were especially important in getting this done.

Each of the elements in the AJAX client is an HTML element which usually has a CSS class of some kind.  So in order to hide a particular button on the AJAX toolbar, for example, you could target that element using javascript and hide it.  The document extension contained in this zip file will read a list of comma delimited CSS classes from a variable in the QVW (vToolbarClass) and hide each of the elements with that class.  For example, the Lock Selection button has a CSS class of ctx-menu-action-LS.  If this class was set in the vToolbarClass variable, the document extension would hide this button on the AJAX toolbar.

In order to make working with this oddly named classes more easy, we've zipped up some things to make the hiding and showing of these elements easier.  For example, a spreadsheet is included which can be modified to set an element to Yes or No.  This sheet can be loaded with some script that's included and passed into the variable.

Overall this zip file contains:

1.     ControlSheet.xls – this is where you can hide or show individual parts of the tool bar

2.     hideIt.qar – the document extension that reads the classes from the variable and hides the elements

3.     Instructions.docx – a word document that contains instructions on how to get the tool bar to hide

4.     Template.qvw – has the extension enabled in it as well as an include file in the script editor

5.     toolBarScript.txt – has the logic needed to be included in the template.qvw script

FYI, if there were other elements in an app that weren't in the toolbar that you wanted to hide, you could use the firebug doc extension to easily determine the classes of these elements and hide those too.  The document extension will attempt to hide any class that is passed into it, whether it's in the ajax bar or not.  Hint hint...you could even use this to hide right click menu options.

Good luck and hope this is helpful!

Attachments
Comments
Partner
Partner

Thanks Brian, really useful idea.

0 Likes
Partner
Partner

Small issue.

I thought Display = Y would mean that it is shown. But it is the opposite.

Display =  N will show and Display = Y will hide.

WAD? 🙂

0 Likes
Support
Support

Hi,

You can change this my editing the ToolBarScript. Just change the WHERE Display = 'Y ;   to WHERE Display = 'N';

Bill

0 Likes
Partner
Partner

Thanks for this great extension. We are leveraging this in a large QlikView implementation.

I have three questions regarding the extension:

  1. If a user performs a right click while the document is still loading, the "hidden" options still show-up. Is there a way to hide the options also during page load?
  2. Sometimes the borders/shadow of the full context menu (without hidden options) are still displayed (see attached screenshot). Do you know a way to fix this? We are using Internet Explorer 9.
  3. It would be great if you can add an option to hide the complete top menu bar in the ajax client (we are now leveraging a separate extension for this)

Many thanks!

Emil

screenshot.png

0 Likes
Employee
Employee

Glad to hear it's being put to good use.  To answer your questions:

1) Nothing can really be done about this, unfortunately.  The document extension has to wait until the document is done loading before it can run.  This means that while th document is loading, there may be a small amount of time where some things aren't hidden.

2) I just noticed this.  Let me take a look and see if there's a good fix.

3) I updated the excel spreadsheet in the zip file above to include a listing for the full toolbar.  It can be hidden using the "QvAjaxToolbar" class

0 Likes
wunderch
New Contributor II

Hi,

is there a chance to get the "Search"-Button from the IE-Plugin

in the Ajax-Toolbar?

0 Likes
Employee
Employee

IE Plugin doesn't run extensions

0 Likes
Not applicable

Hi,

I tried this and have no success. Not sure where I am erring.

After I run the hideit.qar file, I do not see the folder called "Extensions" under C:\ProgramData\QlikTech\QlikViewServer, though I see the hideit under Extenions tab when I open the .qvw file.

My requirement is to hide the entire tool bar and so I changed the property of that on the control sheet to "N" and reloaded the app and I still see the bar.

Do I need to have  Controlsheet.xls, Template.qvw and toolbarscript in the same folder for this work.

(I already have all these in a same folder and it still would not work)

Any help is greatly appreciated,

0 Likes
Not applicable

I'm also unable to get this working on 11.20 SR5. Can anyone confirm that it works with the later versions?

0 Likes
Not applicable

Indeed this isn't working for me either on the latest version.  We're defining an alternate extensions folder for QVS (a file share) and I put all the files in there (ControlSheet, toolbarscript.txt & the hideit script/folder).  The extension is active in my document and I have the load line in line 1.  But alas, it doesn't seem to be working.  Any ideas?

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2013-05-03 12:45 PM
Updated by: