PDA

View Full Version : Combo Box's lazyRender config option appears to not working



samax
15 Jun 2009, 5:36 AM
Hello,
I use the "lazyRender" config option for a combobox to avoid it to be rendered before I ask it to do it. Unfortunately, it doesn't do anything: the field is rendered at the rendering of the form.

Here is my field configuration:


{name:'structures__codeconservation',fieldsetid:'structures_fieldset',fieldLabel:'codeconservation',hiddenName:'structures__codeconservation',xtype:'combo',emptyText:'Enter a value',triggerAction:'all',mode:'local',lazyRender:true,store:new mmw.bib_conservationStore,displayField:mmw.baseSfBib_conservationObject.displayField,valueField:mmw.baseSfBib_conservationObject.keyField},


Can someone help me to resolve this issue?

Thanks

Animal
15 Jun 2009, 5:41 AM
lazyRender is for when transforming a <select> It only transforms the <select> element when it (the ComboBox) is rendered.

samax
15 Jun 2009, 6:01 AM
Thank you for your answer. So, there is nothing in the config options to prevent the field from rendering?

Animal
15 Jun 2009, 6:08 AM
Are you wanting it to be hidden?

samax
15 Jun 2009, 6:22 AM
No, in fact it's a bit complicated. I retrieve in one request the data of the stores of multiple fields. Then I use it to fill each store. The problem is that I must fill the store before the rendering of the fields (because I haven't succeeded to make visible the data contained in the field when I load the store data after the rendering of the field). So, I must stop the rendering of it until I retrieve the data (the data which will fill the store of the fields), and then I can fill the stores, and to finish, render each field.

Animal
15 Jun 2009, 6:27 AM
Do your rendering after the Stores are loaded.

samax
15 Jun 2009, 6:40 AM
Yes I know, it's what I want to do, but the rendering is did automatically, and that's why I want to pause it (the rendering of the fields), to be able to do this manually. And that's the problem, I search a way to do this.

Animal
15 Jun 2009, 7:02 AM
It's done when you ask for it to be done.

samax
15 Jun 2009, 7:27 AM
Ok I see, but now I can't render my fields because I must find them with the findField method of the BasicForm class (because I put the data of the fields in a array field identified by the name, or the hiddenName of the field), and it seems that this method doesn't work before the rendering of the field.
It's a real headache!

Animal
15 Jun 2009, 7:29 AM
I dont get you.

WHy "must" you fnid them with findField?

Create them, and use them!

joec2000
27 Jan 2011, 8:50 AM
Sorry to resurrect such an old post, but this one is pretty similar to an issue I'm currently dealing with.

Putting the "why" question aside here for a moment, how does one make "it [rendering] done when you ask for it to be done."? Can you provide an example or documentation explaining how to do this?

Thanks and great work on ExtJS!

- Joe