Jonathan Clark
Posts: 0
Joined: Thu Mar 14, 2013 5:25 pm

Me Again! Setting label while processing array or results

Another question regarding array of results. I'm still dealing with the issue of recieving two values from each record returned in a database query, performing a calculation, and returning just the result of the calculation. I think Im REALLY close but still having one small problem.

I currently have the array records ($) mapped to a grid object that contains various labels to display the different values from each record. I am then performing a custom javascript function that extracts two fields (postLat & postLong), runs those values through a javascript function, and then sets the text of a label within the grid to the value returned from the function.

Everything appears to be working great except when the label that gets set is the label in the grid from the previously returned record. I think I understand why this is happening I'm just not sure of the way to fix it. As always, I appreciate any advice you all have. THANKS!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Me Again! Setting label while processing array or results

Can you post more details as to exactly what's happening? A screen shot would help.

Jonathan Clark
Posts: 0
Joined: Thu Mar 14, 2013 5:25 pm

Me Again! Setting label while processing array or results

O.K. Hopefully this will help describe the problem a little more:

Here is the mapping: Image

You can see I have each record ($) mapped to a grid component that contains a bunch of labels, and that I am running some custom javascript:
Image

In that custom javascript I attempt to set the text value of a label contained inside the grid component. The problem is that when I set the label, it actually sets the text of the label in the previously created grid component:
Image

so the long numeric value on the top grid element should actually be displayed in the grid component below. Hopefully that helps explain the problem a little better. Let me know if that's still not exactly clear. Thanks!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Me Again! Setting label while processing array or results

Hello! Try code$('[dsid=lbl_Distance]', element).text(dist);/code instead of codeTiggzi('lbl_Distance').text(dist);/code

Jonathan Clark
Posts: 0
Joined: Thu Mar 14, 2013 5:25 pm

Me Again! Setting label while processing array or results

YAY! Marina saves the day again. Works perfect now, and based off the example I understand now why it was doing what it was. Thanks again.

Return to “Issues”