Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I can display a div in an extension object with a hot-linked image from the web easily enough:
Qva.AddExtension('ShowImage', function() {
this.Element.innerHTML = "<div style='width=200px; height:200px; background-image:url(http://www.some.image.jpg)'></div>";
});
But does anybody know how to show an image held locally inside the extension folder (i.e. sitting alongside your definition.xml, script.js and Icon.png)? I've been playing around without success and can't find any documentation or examples. I was hoping CSS 'background-image:url(local-image-in-extension-folder.jpg)' would work, but diesn't seem to.
Thanks!
Hi,
In all of my extensions I set a variable called path to use for locally stored images and things:
var path = Qva.Remote + "?public=only&name=Extensions/ShowImage/";
So you would adjust your code to be:
this.Element.innerHTML = "<div style='width=200px; height:200px; background-image:url(" + path + "some.image.jpg)'></div>";
Hi,
In all of my extensions I set a variable called path to use for locally stored images and things:
var path = Qva.Remote + "?public=only&name=Extensions/ShowImage/";
So you would adjust your code to be:
this.Element.innerHTML = "<div style='width=200px; height:200px; background-image:url(" + path + "some.image.jpg)'></div>";
Awesome, thanks Brian! That works
Brian I have to develop a strategic map based on the balanced scorecard, I was thinking of your org chart as basis for that, can you give me some pointers on how to add custom images to that chart (like the led images inluded in QV)?
Thanks in advance.
bmz, how can I connect a folder from another server?
\\other_server\folder\
Because I can use external sources via http, can I also receive data from another server as locally?
You should be able to reference files from another location as long as they're accessible from wherever your extension is running.
Actually, not sure I understand your question. What do you mean by "receive data" from another server? Do you mean that you want to call out to another server and pull data into the extension to display there? That should definitely be possible.
Thank you, the case is closed.