View Full Version : dynamic links

29 Jan 2010, 5:52 AM
Hello everyone,
I am new to extjs and i need everybod's help.
I need to generate the links at run time according to the data i receive but i dnt know how to do that.
What exaclty happens is that view which we want to see we make all the components beforehand and we just fill the value in them at run time but here i want to make the component at run time. is it possible? or may be thr is some other solution to this.

Thanks in advance

29 Jan 2010, 7:00 AM
Could you please post some code you already have done so far? I guess it's gonna be easiert to show you the way then.

Basically it depends on the used widget to change value or text afterwards.

31 Jan 2010, 8:34 PM
currently my code looks smtg like this:

assetLinkOne.setStyleAttribute("width", "250px");
assetLinkOne.setStyleAttribute("text-decoration", "underline");
assetLinkOne.setStyleAttribute("cursor", "hand");
assetLinkOne.setStyleAttribute("font-size", "12px");
assetLinkOne.setStyleAttribute("color", "blue");
assetLinkOne.setStyleAttribute("text-align", "left");

where assetLinkOne is a label.
i have made 20 links like this and when i make a asynch call i fill in the vales in all the above links like this:

and similarly in all the 20 links.

so i want a kind of strategy where i dnt have to define the links like above and during the asynch i should decide how many links there going to be depending upon my data.

right now i have occupied the space of 20 links in my homepanel.java and at run time if the value comes for 5 links then 5 links comes up and rest 15 are blank, so its not a right approach of doing this.