Hi Nik,
> Thanks for getting back with the feedback, I'll check what's the beef
> with the IE6, I had changed that part a bit, probably lost something
> in transition. (btw could you drop the whole example please? so I
> could safely replicate the issue)
I haven't managed to come up with an isolated test-case yet. This is
kind of hard, since it's a timing-issue and only pops up when filling
several successive select-boxes with option-data. I have an each-loop
doing that in my app but the class is huge and depends on a lot of
other code/markup, so it's not easily extracted.
Here is the relevant function, but it won't work on it's own.
Basically, in it we're building large selectbox-option-lists and then
use #update() to put them in the DOM. BTW I'm using underscore.js here
(though in this case the same could be done using RightJS of course):
[...]
updateGroupCtx: function(event) {
// Transform control-data into hashes with 'key' and 'value' keys,
except
// for plain arrays, which are kept untouched. Also, add an empty
// selection-entry ("-") to each selectbox-list
_.each(event.for_controls, function(ctrl) {
var data = event.data[ctrl + 's'], field_mapping =
this.Options[ctrl + '_fld_map'] || this.Options.default_fld_map;
var selector_element_name = ctrl + '_selector_element',
selector_element_id = this[selector_element_name].getId();
var options = isHash(data.first()) ?
this.addEmptySelectionTo(this.convert_to_options_data(reduceSingleObjectArray(data,
[field_mapping.value_field, field_mapping.id_field]),
field_mapping.value_field, field_mapping.id_field)) :
this.addEmptySelectionTo(data);
try {
// Convert data to selectbox-options and update selectbox with
the
// results
$(selector_element_id).update(new
SelectOptions(options).value());
} catch(e) {
// @PENDING: IE6-workaround:
// the above statement had to wrapped in a try-catch-block
only, because
// of IE6 timing-issues throwing "Error: Could not set the
selected
// property. Unspecified error." when setting selectbox-data +
// selected-property.
}
// Tell the world a selectbox was just updated with new content
$(document).fire(selector_element_name + '_updated', {target: $
(selector_element_id)});
}.bind(this));
},
[...]
I volunteer to be a beta-tester if you need someone to tell you if
it's now working or not.
> regarding the class name, #get('className') should work I think. But
> we probably could have a dedicated method for that as well. btw, do
> you know there is #hasClass method?
What used to be f.get('class')..... now is f._.className because the
former works in FF but not in IE, the latter works in both.
And yes, #hasClass is nice, but in this case I need the actual string:
(from my application.js):
function getGlobalId() {
var f = $('form_model_edit');
return f._.className.split('_').walk('slice', '0', '1').join('') +
f.select('form')[0].get('action').split('/').last();
}
Also, I had to change
[...]
var target = $(event.target);
$(target.form).send({.....}); # gives an error in RightJS >= 2.0
[...]
to
[...]
var target = $(event.target);
$(target._.form).send({.....});
[...]
Which works well, but perhaps there is more elegant way without
resorting to the native DOM-object?
Thanks,
Claus