Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QvaPublic.Layout Field Objects Help Please

Hi,

So I have GetQvObject working and I can send an alert that tells me the name of the object.  But now I want to make changes to the properties of the object.  In this case, the object is a straight table.  What I really want to do is be able to turn off drag and drop of columns.  However, I understand that may not be possible.

I'm trying to understand what properties and values are accessible and HOW to get them through the QV Ajax javascript library.

For instance, I have this code:

var TheChartObject;
var ChartTitle;
Init = function() {
  TheChartObject= qva.GetQvObject("CH03", function () {
          });
}


function DoSomething() {
  alert("Hello World");
  alert(TheChartObject.QvaPublic.Layout.Title.Text);
}

Qva.BodyOnLoadFunctionNames.push("Init");

The alert for the title text comes back as null or not an object.  Ok, so when I got to that Title Field (which is an object in the library), what properties are available to access and change?

Thank you for your help.

Jeff G

3 Replies
Not applicable
Author

I have not found the object returned from the GetQvObject to be useful; it is usually null. You're better off using the the "this" object to retreive the data. In this case use:

  alert(this.Layout.Title.Text);


instead.

Not applicable
Author

ok, this vs. the instantiated object.  However, how do you get "this" to represent the chart I want to access without using GetQvObject?

By the way, this is not for an extension object.  I'm trying to hit objects built into a workbench generated aspx page.  I want to see about the possibility of turning off drag and drop to a chart as well as resizing.  That is my goal.

Thank you for your help.

Jeff G

Not applicable
Author

I should have been more clear. You keep the call to GetQvObject but replace the body of the DoSomething function with alert(this.Layout.Title.Text); so it will look like this:

Init = function() {

  qva.GetQvObject("CH03", DoSomething);

}

function DoSomething() {

  alert(this.Layout.Title.Text);

}

Qva.BodyOnLoadFunctionNames.push("Init");

The DoSomething function is a callback that will execute when the object (CH03 in this case) needs to be drawn. The "this" object refers to the qv object since the object itself will execute the function.