Getting Started | Class Index

Classes


Namespace Qv

The QlikView Ajax namespace you will be using.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Qv
Global object.
Method Summary
Method Attributes Method Name and Description
 
AddExtension(name, extensionPaint)
Function to call in the JavaScript for a QlikView extension to register the extension.
 
GetAllDocuments(callbackFn(object[]))
The supplied callbackFn will be called with the documents, as an array of document objects, as parameter
 
Returns a handle to the current QlikView document.
 
GetDocument(document)
Returns a handle to a QlikView Document with a specific document name.
 
InitWorkBench(config)
Initialize workbench.
 
LoadExtensionScripts(filesArray, callbackFn)
Load javascripts needed for QlikView extension object.
Namespace Detail
Qv
Global object.
Method Detail
{void} AddExtension(name, extensionPaint)
Function to call in the JavaScript for a QlikView extension to register the extension.
The following would be, for example, for an extension contained in
C:\Users\[UserName]\AppData\Local\QlikTech\QlikView\Extensions\
Objects\MyCompanyName\MyExtensionName

The code below would be in a file named script.js contained in the above 
directory. Any associated JavaScript and css files would be contained alongside 
this file.

Note that the exact path above might vary depending on your Windows version and 
whether you are deploying the extension in QlikView server or QlikView desktop.

Example 1:
function paint()
{
    var htmlElement = this.Element;
    var data = this.Data.Rows;
    // Render extension here.
}

Qv.AddExtension("MyCompanyName\MyExtensionName", paint);

Example 2: This example illustrates how a css file for the extension could also 
be loaded.

function paint()
{
    var htmlElement = this.Element;
    var data = this.Data.Rows;
    // Render extension here.
}

Qv.AddExtension("MyCompanyName\MyExtensionName", paint);
Qva.LoadCSS(Qva.Remote + (Qva.Remote.indexOf('?') >= 0 ? '&' : '?') + 'public=only' + '&name=' + "Extensions/MyCompanyName/MyExtensionName/MyStyles.css");
Parameters:
{String} name
Name of the extension
{Function} extensionPaint
Paint function for the extension

{void} GetAllDocuments(callbackFn(object[]))
The supplied callbackFn will be called with the documents, as an array of document objects, as parameter
Example:
function init() {

    Qv.GetAllDocuments(function(docs) {
        // process array here.
    });

}

Qv.InitWorkBench({ View: 'FilmsWebView', BodyOnLoadFunctionNames: ['init'] });
Parameters:
{Function} callbackFn(object[])
Your function which will be called with an array of documents in the data parameter

{Qv.Document} GetCurrentDocument()
Returns a handle to the current QlikView document. Can be used from an extension to access Document data regardless of the document name.
Example:
var myDoc;

Init = function() {

    mydoc = Qv.GetCurrentDocument();

    // Work with document here.
}

Qv.InitWorkBench(
    { 
        View: 'FilmsWebView', 
        BodyOnLoadFunctionNames: ['Init'] 
    });
Returns:
{Qv.Document} Reference to the object.

{Qv.Document} GetDocument(document)
Returns a handle to a QlikView Document with a specific document name.
Example:
Init = function() {

    var doc = Qv.GetDocument("FilmsWebView");
    // Work with document here.
}

Qv.InitWorkBench(
    { 
        View: 'FilmsWebView', 
        BodyOnLoadFunctionNames: ['Init'] 
    });
Parameters:
{String} document
The name of the QlikView document (without extension).
Returns:
{Qv.Document} Reference to the object.

{void} InitWorkBench(config)
Initialize workbench. If you need multiple documents you insert one function call to Qv.InitWorkBench for every document. NB! there can only be one value per page for the following parameters (QvAjaxZfcPath, BodyOnLoadFunctionNames, CSS ) so make sure you put them in the first call to Qv.InitWorkBench (if you want to set them). At a minimum you must supply the parameter View in the call.
Examples:
    Qv.InitWorkBench({ View: 'Films' });
    Qv.InitWorkBench({ View: 'Films', BodyOnLoadFunctionNames: ["MyInit", "MyInit2"],
     CustomIcons: {CA:"NewClearAll.bmp", CD:"NewClear.bmp"} });
Parameters:
{Qv.Config} config
Configuration data for the connection to a QlikView document

{void} LoadExtensionScripts(filesArray, callbackFn)
Load javascripts needed for QlikView extension object.
Example:
function scriptsLoaded()
{
    alert('scriptsLoaded fired');
}

function loadScripts() {
    var files = [];
    files.push("Extensions/MyCompanyName/MyExtensionName/MyJavaScriptFile.js");
    Qv.LoadExtensionScripts(files, scriptsLoaded);
}
Parameters:
{String[]} filesArray
Array of javascripts
{Function} callbackFn
Function to be called when scripts are loaded