XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Apr 29日 09:31

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: getObject by id (tag)
PostPosted: 2012年 Sep 5日 07:47 
Offline

Joined: 2012年 Sep 2日 02:37
Posts: 17
Need a help :)
Please, explain how to get Object by tag number, then set param for this object... or get by children number from widget...
Is't possible? or I must use switch - case and set dynamic number to the object name?


Top
 Profile  
 
PostPosted: 2012年 Sep 6日 00:04 
Offline
User avatar

Joined: 2012年 Jun 10日 05:57
Posts: 315
sorry for my poor English , i can't understand the question, do you want
Code:
var a = image1.tag
image1.tag=2


Top
 Profile  
 
PostPosted: 2012年 Sep 6日 02:59 
Offline

Joined: 2012年 Sep 2日 02:37
Posts: 17
I want to get Image with specific tag, and set Src for this image.
for example: Image.attr(tag=i).Src = Value; Or widget.children[i].Src = Value;
or can I push all object's children to the array? I think not..

I found this solution is working for me:
Code:
switch(i)
     {
      case 1: image1.Src = images[i].ico+'.png'; break;
      case 2: image2.Src = images[i].ico+'.png'; break;
      case 3: image3.Src = images[i].ico+'.png'; break;
      case 4: image4.Src = images[i].ico+'.png'; break;
      case 5: image5.Src = images[i].ico+'.png'; break;
     }


Top
 Profile  
 
PostPosted: 2012年 Sep 6日 05:00 
Offline
User avatar

Joined: 2012年 Jun 10日 05:57
Posts: 315
Shezoid wrote:
I want to get Image with specific tag, and set Src for this image.
for example: Image.attr(tag=i).Src = Value; Or widget.children[i].Src = Value;
or can I push all object's children to the array? I think not..

I found this solution is working for me:
Code:
switch(i)
     {
      case 1: image1.Src = images[i].ico+'.png'; break;
      case 2: image2.Src = images[i].ico+'.png'; break;
      case 3: image3.Src = images[i].ico+'.png'; break;
      case 4: image4.Src = images[i].ico+'.png'; break;
      case 5: image5.Src = images[i].ico+'.png'; break;
     }


maybe it will help
Code:
eval("image"+i).Src= images[i].ico+'.png';


Top
 Profile  
 
PostPosted: 2012年 Sep 6日 05:38 
Offline

Joined: 2012年 Sep 2日 02:37
Posts: 17
Very helpful, thank you :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group