PDA

View Full Version : renderer wait/sleep



hardeep.kwatra
22 Mar 2011, 10:34 PM
Hi,

I am facing a strange kind of problem. i have a grid which contains a country combo and the city combo.

the city store gets loaded as soon as the user selects the country from the drop down (passing the country code as parameter).

the issue comes when we show the grid to the user with the saved values in the DB. i've used the renderer for grid coumns to show the country name instead of country code and the same is for city. this is where the problem arises.

as my city store is not already loaded i am loading it in the renderer of the country coumn but the rendere of the city column does not wait for the store to be loaded and returns the city code itself so, the city code is shown in the city combo.

is there any way to make city column renderer to wait till the store gets loaded?

any help is appreciated in advance

hpet
23 Mar 2011, 12:23 AM
Why don't you move combo store load to some earlier stage (like initialy when app starts, or something similar). If there is alot of data then this is not so good.

I would "plant" display value and hidden value "manualy" when saved DB value is selected (but for this to work you must have display value available with saved DB record, not just its ID). This way combo will show correct values, and it will still "auto load" it self on some other event, like dropdown.

hardeep.kwatra
23 Mar 2011, 12:55 AM
Thanks for the reply,

Yes the store contains a huge number of data, that's why we are not loading it on the initial stage.

the DB is designed in such a way that it only contains ID not the display value along with and we can not make such change in the DB table.

any work around for it?

hpet
23 Mar 2011, 12:57 AM
Can't you change the backend DB query to give you country/city description as well?

I can't think of any other way.

hardeep.kwatra
23 Mar 2011, 1:01 AM
I got your point......

let me try it... and would get back on it.

thanks for the help :)