Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7776 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Problems inserting table cells in IE

Reported by: david.easley Assigned to: Tobie
Priority: normal Milestone: 1.x
Component: Prototype Version: edge
Severity: normal Keywords: 1.5.2
Cc:

Description

Prototype version: 1.5.0

Problem description: IE6 gives "Invalid target element for this operation" error on attempting to insert a new TD after an existing cell. (In my case the existing cell was a TH at the beginning of the row, but I assume the same error would happen if the existing cell was a TD, or if it wasn't the first cell in the row.)

Possible patch (works for me): Just beneath these two lines at L1631:

if (['TBODY', 'TR'].include(tagName)) {

this.insertContent(this.contentFromAnonymousTable());

... insert more of the same:

} else if (['TH', 'TD'].include(tagName)) {

this.insertContent(this.contentFromAnonymousTableRow());

Definition of new function contentFromAnonymousTableRow:

contentFromAnonymousTableRow: function() {

var div = document.createElement('div'); div.innerHTML = '<table><tbody><tr>' + this.content + '</tr></tbody></table>'; return $A(div.childNodes[0].childNodes[0].childNodes[0].childNodes);

}

Change History

05/03/07 02:13:00 changed by Tobie

  • keywords changed from Insertion to 1.5.2.
  • owner changed from sam to Tobie.
  • summary changed from Error in IE6 on inserting table cell after an existing cell to Problems inserting table cells in IE.

05/12/07 05:02:00 changed by sam

  • status changed from new to closed.
  • resolution set to fixed.

(In [6725]) Merge -r6634:HEAD from ../branches/dom.

* Make Element#update and Element#insert work for SELECT tags in IE and Opera. [Tobie Langel]

* Make Element#insert and Element#update better handle TABLE related elements in IE and Opera. Closes #7776, #8040, #7550, #7776, #7938. [Tobie Langel]

* Make Element#readAttribute('title') work in Opera. [Tobie Langel]

* Make Element#replace work with form elements in Firefox and Safari. Closes #8010, #7989. [dsl239, Tobie Langel]

* Add Element#wrap which wraps the element inside a new one. Closes #5732. [P. Vande, Tobie Langel]

* Make Element into a constructor: new Element(tagName, attributes). Add Element#writeAttribute which accepts a hash of attributes or a name/value pair. Closes #7476. [Mislav Marohni?\196?\135, haraldmartin, Tobie Langel]

* Insertion overhaul: Add Element.insert(content[, position = 'Bottom']). Deprecate Insertion (kept for backwards compatibility). Make Ajax.Updater option.insertion accept both Insertion.Top or the now preferred 'Top'. Closes #7907. [Tobie Langel]