Page 1 of 1

Me Again! Setting label while processing array or results

Posted: Wed Mar 27, 2013 12:18 am
by Jonathan Clark

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!


Me Again! Setting label while processing array or results

Posted: Wed Mar 27, 2013 12:29 am
by maxkatz

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


Me Again! Setting label while processing array or results

Posted: Wed Mar 27, 2013 2:35 am
by Jonathan Clark

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!


Me Again! Setting label while processing array or results

Posted: Wed Mar 27, 2013 8:25 am
by Maryna Brodina

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


Me Again! Setting label while processing array or results

Posted: Wed Mar 27, 2013 7:19 pm
by Jonathan Clark

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.