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!