PDA

View Full Version : Single json post for a grid and a JsonView



BernardChhun
5 Jan 2007, 7:40 AM
Hey there,

I've been struggling with this all morning long now.
I have made this little search engine that displays its results in 2 yui-ext controls.
There's a JsonView with a template similar to the photo album example and a grid. The users can choose the view style they prefer.

Until now, I had to make 2 posts to fetch the data and insert them in both control. The 2 has to be linked so that when the user switches from the JsonView to the grid (or the other way around), it shows the exact same data.

Now I want to make a single post and fill both controls. I am able to save the Json Data in a variable and insert it in the grid later on.

I can't seem to do it with the JsonView. According to the docs, the only function that loads data into the JsonView is load() and it makes a get or post request everytime.

Is there a way to do what i'm trying without posting twice? Am I going the wrong way with this?

thanks for any responses..be it bad or good :)
Bernard

jack.slocum
5 Jan 2007, 10:12 AM
You can change the jsonData property to your new data and call refresh().

BernardChhun
5 Jan 2007, 10:28 AM
You can change the jsonData property to your new data and call refresh().

:shock: damn I'm dumb. thank you for the response Jack.