Opened 11 years ago

Closed 11 years ago

#12204 closed defect (fixed)

[regression] Problem of defining source html table of HtmlStore in the TitlePane

Reported by: tbbt Owned by: bill
Priority: high Milestone: 1.6
Component: DojoX Data Version: 1.6.0b1
Keywords: HtmlStore TitlePane Cc:
Blocked By: Blocking:

Description (last modified by Kenneth G. Franqueiro)

When defining a source html table of HtmlStore in the TitlePane,the DataGrid fed by such HtmlStore will not be shown. The source code is as following:

    <style type="text/css">
      @import "dojoroot/dijit/themes/claro/claro.css";
      @import "dojoroot/dojo/resources/dojo.css"
      @import "dojoroot/dojox/grid/resources/Grid.css";
      @import "dojoroot/dojox/grid/resources/claroGrid.css";
      .grid {
          width: 50%;
          height: 100%;       
          padding: 1px;
          border: solid 1px black;
    <script type="text/javascript" src="dojoroot/dojo/dojo.js"
      djConfig="parseOnLoad: true">
    <script type="text/javascript">

        var unitInfoLayout = [[
            { field : "UnitType", name : "Unit Type", width: "40%" , headerStyles : "text-align: center" },
            { field : "UnitFamily", name : "Unit Family", width : "35%", headerStyles : "text-align: center" },
            { field : "Amount", name : "Amount", width : "25%" , headerStyles : "text-align: center" }
<body class="claro">
<div dojoType="dijit.TitlePane"  title="Unit Info Table" style="margin: 5px">
    <table id="unitInfoSrcTable" style="display:none">
    <div dojoType="" jsId="unitInfoStore" dataId="unitInfoSrcTable" >
    <table id="unitCountGrid" class="grid" dojoType="dojox.grid.DataGrid" store="unitInfoStore"
         structure="unitInfoLayout" query="{}" autoHeight="true" rowsPerPage="25" >

The code has worked in previous releases.

Change History (5)

comment:1 Changed 11 years ago by Kenneth G. Franqueiro

Description: modified (diff)
Summary: Problem of defining source html table of HtmlStore in the TitlePane[regression] Problem of defining source html table of HtmlStore in the TitlePane

comment:2 Changed 11 years ago by Kenneth G. Franqueiro

Just to clarify, from what little I was able to gather:

This code works in Dojo 1.5 (also tried 1.4 and 1.3.2 using Tundra, fine there too). It dies in 1.6 because the contents of the TitlePane's srcNodeRef appear to have been wiped out before they get parsed - which means that at the time the HtmlStore gets instantiated, the table no longer exists.

I'm thinking the regression may be due to either parser or ContentPane changes but I haven't been able to put my finger on it.

FWIW, this is easily worked around simply by moving the table that is the source of the HtmlStore's data, outside the TitlePane, but the point remains that this used to work and now doesn't, and is thus a regression.

comment:3 Changed 11 years ago by bill

Component: GeneralDijit
Milestone: tbd1.6
Owner: anonymous deleted

Hmm, well I see what's going on but it's not easy to fix.

The <table> node has been moved inside of the TitlePane.containerNode. But, the TitlePane.domNode hasn't been attached to the document yet. So, HtmlStore is calling dojo.byId(args.dataId) with unfortunate timing, and it isn't finding the <table>

Dijit has a rule that widgets shouldn't assume they are attached to the DOM, nor that other sibling/parent/child widgets exist, until the startup() call, but changing that in HtmlStore might break other apps if they aren't calling HtmlStore.startup(). Plus which, it complicates the API.

One workaround is to put the <table> node outside of the TitlePane. Could also put the HtmlStore outside the TitlePane.

comment:4 Changed 11 years ago by bill

Component: DijitDojoX Data
Owner: set to bill
Status: newassigned

OK, HTMLStore, like ItemFileReadStore, has code to defer loading until the first fetch. It just doesn't quite work right. I'll fix it.

comment:5 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [23654]) Removed call to _indexItems() in the constructor. The rest of the code was designed to defer loading data until the first fetch call and this was interfering.

Don't set store variable on each row DOMNode, pointing back to the javascript Object. This is the cardinal sin causing memory leaks on IE, due to circular references.

Fixes #12204 !strict.

Note: See TracTickets for help on using tickets.