>
> $posts = new Albums();
> $this->view->albums = $posts->fetchAll();
> $row = $posts->fetchAll();
> $rowArray = $row->toArray();//this works for me
> $data = new Zend_Dojo_Data('id', $rowArray);
> $this->view->data = $data;
>
Hm, I'm trying the code above and it works with some datasets and not
others... My table rows are pretty consistent and simple though... but I'm
getting: Overwriting items using addItem() is not allowed.
here's a sample of the array that's getting sent to Zend_Dojo_Data. Anything
untowards here? This is an array of associative arrays as noted above? It's
just a Zend_DB_Table_Row from a fetchAll().
Is there some other trick in using Zend_Dojo_Data?
<code>
[1] => Array
(
[id] => 1
[users_id] => 1
[obj_id] => 1
[date_created] => 2007-02-14 00:00:00
[date_updated] =>
[URI] =>
http://farm4.static.flickr.com/3077/2412099024_e4a32daaf0.jpg
[ext] =>
[mime] =>
)
[2] => Array
(
[id] => 2
[users_id] => 1
[obj_id] => 2
[date_created] => 2007-02-14 00:00:00
[date_updated] =>
[URI] =>
http://farm3.static.flickr.com/2250/2492521769_fc1ae14d0b.jpg
[ext] =>
[mime] =>
)
</code>
Thanks for any advice!!
When it is working, Zend_Dojo_Data kicks serious ass...
--
View this message in context: http://www.nabble.com/How-to-correctly-use-Zend_Dojo_Data-tp19149257p19537542.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论