Child/Details Row Displaying as 'row' in Chrome

Child/Details Row Displaying as 'row' in Chrome

karlhkarlh Posts: 3Questions: 1Answers: 0

I've got a table where all the details rows are supposed to be visible under certain conditions. I generate the regular rows and the details rows in the code behind, attaching the details row by adding it as an attribute to the regular row as a string (which contains formatted html). Like so:

for each record...

                    StringBuilder sb = new StringBuilder();
                    HtmlTextWriter htw = new HtmlTextWriter(new System.IO.StringWriter(sb, System.Globalization.CultureInfo.InvariantCulture));
                    holderRow.RenderControl(htw);
                    string html = sb.ToString();
                    tr.Attributes.Add("child-value", html);
                    table_body.Controls.Add(tr);

And this works just fine in IE. But in Chrome, the details row shows none of the details. It only shows 'row' (see attached 'example.PNG').

Here's my js to show all the details rows:

        function CreateDataTableWithDetails() {
            var table = $('#tableConferenceRoomReports').DataTable({
                dom: 'rt',
                paging: false,
                order: [[6, 'asc'], [1, 'asc'], [0, 'asc']],
                stateSave: true
            });

            table.rows().every(function () {
                var tr = $(this.node());
                for (var i = 0; i < tr.context.attributes.length; i++) {
                    if (tr.context.attributes[i].name == 'child-value') {
                        this.child(tr.context.attributes[i].value).show();
                    }
                }
            });

I've confirmed that the 'value' attribute does in fact contain the child-data attached in the code behind ('nodeValue' and 'textContent' have the same data). And, like I said, it works fine in IE. Any idea what I'm missing?

This question has an accepted answers - jump to answer

Answers

  • karlhkarlh Posts: 3Questions: 1Answers: 0

    bumpity.

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    Have you looked at the raw html generated by your server side code? Unfortunately, I have found IE to be more "forgiving" on html such as missing closing tags, etc than Chrome so things that worked in IE didn't in Chrome

  • allanallan Posts: 63,234Questions: 1Answers: 10,417 Site admin

    Could you show us a console.log of tr.context.attributes[i].value?

    Allan

  • karlhkarlh Posts: 3Questions: 1Answers: 0

    Well, with absolutely no changes, it seems that it's working fine today. :/

    Here's the console.log of tr.context.attributes[i].value, in case anyone can spot what would make the issue come and go.

    <tr id="detailsRow_409714" class="col-xs-12">
        <td id="detailsCell_409714" style="width:1308px;"><div style="background-color:WhiteSmoke;width:32%;float:left;margin:10px;border:1px solid;border-radius:5px;box-shadow:3px 3px 5px #535353;">
            <fieldset>
                <legend>
                    <p class='small' style='padding-top:2px; margin-bottom:-5px;'>&nbsp;General</p>
                </legend><table style="margin-top:-15px;">
                    <tr class="small" style="background-color:WhiteSmoke;">
                        <td class="col-xs-4 text-right" valign="top" style="font-weight:bold;">Meeting Title:</td><td class="col-xs-8 text-left" valign="top">Some Title</td>
                    </tr><tr class="small" style="background-color:WhiteSmoke;">
                        <td class="col-xs-4 text-right" valign="top" style="font-weight:bold;">Reservation Type:</td><td class="col-xs-8 text-left" valign="top">Some Type</td>
                    </tr><tr class="small" style="background-color:WhiteSmoke;">
                        <td class="col-xs-4 text-right" valign="top" style="font-weight:bold;">CM# or GL#:</td><td class="col-xs-8 text-left" valign="top">Some Number</td>
                    </tr><tr class="small" style="background-color:WhiteSmoke;">
                        <td class="col-xs-4 text-right" valign="top" style="font-weight:bold;">Extension:</td><td class="col-xs-8 text-left" valign="top">Some Extension</td>
                    </tr>
                </table>
            </fieldset>
        </div></td>
    </tr>
    
  • allanallan Posts: 63,234Questions: 1Answers: 10,417 Site admin
    Answer ✓

    Possibly some old cached file that has been cleared out by the browser now?

    Either way, good to hear that it is working now.

    If you run into the issue again, I think we'd need a link to a test case showing the issue to be able to debug it.

    Allan

This discussion has been closed.