One-to-many Associations Empty Columns Issue (Ext on Rails)

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2009-08-10T20:24:23Z Indexed on 2010/05/23 16:10 UTC
Read the original article Hit count: 174

Filed under:
|
|
|
|

I'm playing with rewriting part of a web application in Rails + Ext. However, I'm having trouble getting an associated models' name to display in the grid view.

I've been able to successfully convert several models and arrange the views nicely using tabs and Ext's layout helpers.

However, I'm in the middle of setting up an association -- I've followed along with Jon Barket's tutorial on how to do this using Ext -- and I've made all the Rails and JS changes suggested (with appropriate name changes for my models,) the result being that the combo box is now being correctly populated with the names of the associated models, and changes are actually written correctly to database, BUT the data doesn't show up in the column, it's just empty. However, the correct data is there in the 'detail' view.

Really just wondering if anyone else ran into this, or had any thoughts on what could be happening. Definitely willing to post code if requested; just note that (AFAIK) my changes follow the tutorial pretty closely.

Thanks in advance!

UPDATE:

Alright, slight progress - kind of. I can get the associated model id # displaying properly -- just by modifying the column model slightly. But I can't get the virtual attribute displayed in the main table (in Jon's example it's country_name.) It still goes blank when I change the data source for that column from

dataIndex: 'model[associated_model_id]'

to

dataIndex: 'virtual_attributes[associated_model_name]'

ANOTHER UPDATE:

Bump. Has NOBODY here tried integrating Ext with Rails?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ruby-on-rails