Skip to main content Skip to complementary content

createGenericObject method

app.createGenericObject(def, callback)

Method used to create a generic object and register callback to receive the data. The generic object can contain the following:

  • qHyperCubeDef
  • qListObjectDef
  • qStringExpression
  • qValueExpression

The callback method will be called whenever the selection state changes in a way that affects the generic object. The parameter will be the evaluated version of the definition.

Parameters

Name Type Description
def Object Generic object definition
callback Function Callback method

Returns

A promise of an object model.

Tip noteFor more information regarding a promise, see http://docs.angularjs.org/api/ng.$q.

Example

app.createGenericObject( { user: { qStringExpression: "=QVUser ()" }, version : { qStringExpression: "=QlikViewVersion ()" }, fields: { qValueExpression: "=Count (DISTINCT $Field)" } }, function ( reply ) { var str = "Version:" + reply.version + " Fields:" + reply.fields; if ( reply.user ) { str += " User:" + reply.user; } $( "#info" ).html(str); });

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!