woollights / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TabularView's column contexts "overwrite" eachother #325

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a tabular view trought a call to Exhibit.TabularView.create (and
not createFromDOM) with two columns that show the same item but with two
different formats.
2.
3.

What is the expected output? What do you see instead?
I expect to see the items formatted in the first column differently than in
the second but what I see is both columns formatted as specified for column 2.

What version of the product are you using? On what browser and what
operating system?
Exhibit trunk, firefox, linux.

Please provide any additional information below.

If a tabular view is created programmatically through a call to create
(instead of through createFromDOM), then the uiContexts of the columns are
not well seperated. In Exhibit.TabularView._configure about the middle
there is:
if (format != null && format.length > 0) {
   format = Exhibit.FormatParser.parse(view._uiContext, format, 0);
}....
Since the parser changes the first argument (view._uiContext), it is the
format of the last column that is used in displaying the item in all
columns, even though earlier columns might have set another format.
The solution is for each column to have its own uiContext as is done in
Exhibit.TabularView.createFromDOM.
So the line above becomes something like:
var uiContext = Exhibit.UIContext.create({}, view._uiContext, true);
if (format != null && format.length > 0) {
    format = Exhibit.FormatParser.parse(uiContext, format, 0);
}...
and the right format needs to be pushed on the view._columns:
   uiContext: uiContext
instead of
   uiContext: view._uiContext
as it is now.

Original issue reported on code.google.com by m.d.na...@hetnet.nl on 9 Oct 2009 at 11:17

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 9:36