I observe that the following $$ expression works fine in both Firefox and IE7. The css class "period" is placed on some <TR>s. var rowArray = $$("#" + empTableId + " tbody .period"); var periodCount = rowArray.size(); In contrast, the following expression works in Firefox, but fails to return dynamically added <TR>s in IE. (It does return static HTML in both Firefox and IE.) widgetArray = $$("#" + empTableId + " tbody tr td div .timeWidget"); var widgetCount = widgetArray.size(); The css class is placed on "input type=''text''" widgets. Is this some kind of known problem? Thanks very much. . . Bill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BillT
2007-Nov-29 14:04 UTC
<Input> Expressions for $$ Fail in IE for Dynamically Added <TD> Enclosing <Input>
I found where the combination of $$ and IE7 breaks down in the series of nested HTML. Again, it works fine in Firefox in all conditions I have tested, and it works fine in IE7 for static HTML. Consider the following series of debugging statements: var debugTBodyTrArray = $$("#" + empTableId + " tbody tr"); var debugTBodyTrTdArray = $$("#" + empTableId + " tbody tr td"); var debugTBodyTrTdDivArray = $$("#" + empTableId + " tbody tr td div"); var debugTBodyTrTdDivInputArray = $$("#" + empTableId + " tbody tr td div input"); alert("debugTBodyTrArray.size before clone and insert: " + debugTBodyTrArray.size() ); alert("debugTBodyTrTdArray.size before clone and insert: " + debugTBodyTrTdArray.size() ); alert("debugTBodyTrTdDivArray.size before clone and insert: " + debugTBodyTrTdDivArray.size() ); alert("debugTBodyTrTdDivInputArray.size before clone and insert: " + debugTBodyTrTdDivInputArray.size() ); I then add a <TD> enclosing an <Input> to the DOM as follows: var clonedRow = rowArray[0].cloneNode(true); tbody.insertBefore(clonedRow, ptoRow); Then I revisit the series of debugging statements, as follows: var debugTBodyTrArray2 = $$("#" + empTableId + " tbody tr"); var debugTBodyTrTdArray2 = $$("#" + empTableId + " tbody tr td"); var debugTBodyTrTdDivArray2 = $$("#" + empTableId + " tbody tr td div"); var debugTBodyTrTdDivInputArray2 = $$("#" + empTableId + " tbody tr td div input"); //the problem occurs here !!! alert("debugTBodyTrArray2.size before clone and insert: " + debugTBodyTrArray2.size() ); alert("debugTBodyTrTdArray2.size before clone and insert: " + debugTBodyTrTdArray2.size() ); alert("debugTBodyTrTdDivArray2.size before clone and insert: " + debugTBodyTrTdDivArray2.size() ); alert("debugTBodyTrTdDivInputArray2.size before clone and insert: " + debugTBodyTrTdDivInputArray2.size() ); The number of tr''s, td''s, and div''s is reported to increase in this second set of statements, as they should. However, the reported number of input''s is improperly reported to be unchanged. The IE7 Developers Toolbar and the Firefox View Generated Source both show the same <input> nested within the <div>, which is nested within the <td>, as follows: <TD class="middle_cell_style" noWrap height="23"> <DIV align="center"> <INPUT class="emp1Time" id="emp1SatPer3Start" readOnly maxLength="8" size="7" name="emp1SatPer3End" _counted="undefined" value="" /> </DIV> </TD> Bill ------------------------------------------------------------------------------------------------ On Nov 28, 5:35 pm, BillT <bill.treu...-dyMiKL5CszI@public.gmane.org> wrote:> I observe that the following $$ expression works fine in both Firefox > and IE7. The css class "period" is placed on some <TR>s. > > var rowArray = $$("#" + empTableId + " tbody .period"); > var periodCount = rowArray.size(); > > In contrast, the following expression works in Firefox, but fails to > return dynamically added <TR>s in IE. (It does return static HTML in > both Firefox and IE.) > > widgetArray = $$("#" + empTableId + " tbody tr td div .timeWidget"); > var widgetCount = widgetArray.size(); > > The css class is placed on "input type=''text''" widgets. > > Is this some kind of known problem? > > Thanks very much. . . Bill--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---