Problem with images in a grid

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Problem with images in a grid

Post by mwalter »

I'm having an issue with images in a grid. I have a grid that has image thumbnails. What I'd like to do is, when an image is clicked, grab the property image source, and use it to show a window with a full sized image. I'm using the following javascript to get the image source.
var imgSrc = getObj(this).pui.properties("image source");
However, when I execute it, I get the error "Cannot read property "pui" of null". Which is telling me that the object is null.
I've also tried getObj with the object ID. I've double and triple checked my spelling.

Any Ideas?
Darpan
New User
Posts: 1
Joined: Tue Aug 08, 2017 12:01 pm
First Name: Darpankumar
Last Name: Patel
Company Name: Profound Logic Software
Phone: 9374397925
Address 1: 396 Congress Park Drive
City: Dayton
State / Province: Ohio
Zip / Postal Code: 45459
Country: United States
Contact:

Re: Problem with images in a grid

Post by Darpan »

Hello,

The following documentation page explains how to retrieve a widget property:
http://www.profoundlogic.com/docs/displ ... t+property

We don't have any specific API to retrieve property of widget but we have special code that can achieve this task.

getObj(id).pui.properties[propertyName];

Can you please try using object Id and use square brackets for property name.

var imgSrc = getObj("Image1").pui.properties["image source"];

This code worked for me. I was able retrieve the value of image source.
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Re: Problem with images in a grid

Post by mwalter »

I've tried this. The difference is that the images are in a grid. I have 6 image widgets in a grid row. It's acting like the id's are not there. WHen I try something like alert(getObj("IMGNAME")); on the onClick event, it returns Null.
User avatar
Emily
Profound Logic Staff Member
Posts: 89
Joined: Tue Jun 21, 2016 8:30 am
First Name: Emily
Last Name: Seage
Company Name: Profound Logic
Contact:

Re: Problem with images in a grid

Post by Emily »

Hi Mark,

Because your images are in a grid, you will need to append the row number to the ID of the image. So, you'd need to do something like this:

var imgSource = getObj("IMGID." + row).pui.properties["image source"];

I tested this on my end and it seemed to work as expected. Could you give this a try and see if this works for you?

I hope that this helps!
Emily Seage
Support Team Lead
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Re: Problem with images in a grid

Post by mwalter »

Awesome Emily. I'll give that a try.
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Re: Problem with images in a grid

Post by mwalter »

Works perfectly. Thank you.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests