cristianotestai Posted July 22, 2011 Share Posted July 22, 2011 Hi Farshad, I need to specify an object (UniPanel) concatenating strings in JS. I tried following in run-time, but without success, everything is ok, only the last statement does not work, because he does not understand 'UniPanel+usuid': UniImage1.ClientEvents.ExtEvents.Values ['onclick'] = 'onclick function (sender)' + '{var usuid = Main.UniPanel1.UsuId;' + ' Main.UniPanel1.UsuId =' + IntToStr (UsuId) + ';' + ' Main'. UniImage1.Parent.Name + '. body.applyStyles(' + QuotedStr('background-color: #FDEDE3')+');' ' Main'. + 'UniPanel+usuid' + '. body.applyStyles(' + QuotedStr('background-color: #FDFCFB')+');' '}'; In the last statement, the translation will be for example "Main.UniPanel2.body.apply...", where in this example the value of "usuid" variable = 2. How to perform the concatenation correctly for him to find the object? Tkanks. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 22, 2011 Administrators Share Posted July 22, 2011 You can not add a number to an object: MainForm.UniPanel+usuid Instead you can use below syntax: MainForm["UniPanel"+usuid].body..... Link to comment Share on other sites More sharing options...
cristianotestai Posted July 22, 2011 Author Share Posted July 22, 2011 You can not add a number to an object: MainForm.UniPanel+usuid Instead you can use below syntax: MainForm["UniPanel"+usuid].body..... Tks again.. perfect.. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now