Note that there are some explanatory texts on larger screens.

plurals
  1. PODojo TabContainer doesn't get formatted correctly until after I do an Inspect Element
    primarykey
    data
    text
    <p>I have a Dojo <strong>DataGrid</strong> with a few rows of data. When I click on a row, I have a <strong>TabContainer</strong> created in another <code>&lt;div&gt;</code>. Here's what it ends up looking like:</p> <p><img src="https://i.stack.imgur.com/USlid.png" alt="initial load"></p> <p>The formatting for the <strong>TabContainer</strong> is incorrect. However, after I do an "Inspect Element", the formatting corrects itself:</p> <p><img src="https://i.stack.imgur.com/Pdiak.png" alt="after inspect element"></p> <p>However, the <strong>Submit</strong> button disappears after the formatting is corrected. </p> <p>Here's the code I use to create the <strong>DataGrid</strong> and <strong>TabContainer</strong>:</p> <pre><code>&lt;div id="r_body"&gt; &lt;div id="r_list"&gt; &lt;/div&gt; &lt;div id="r_form"&gt; &lt;div data-dojo-type="dijit/form/Form" id="parameters_form" data-dojo-id="parameters_form" encType="multipart/form-data" action="" method=""&gt; {% csrf_token %} &lt;div&gt; &lt;div id="r_tab_container"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;p&gt;&lt;/p&gt; &lt;button id="submit_parameters" dojoType="dijit/form/Button" type="submit" name="submitButton" value="Submit"&gt; Submit &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; require([ "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojox/grid/DataGrid" , "dojo/data/ItemFileWriteStore" , "dojo/dom", "dojo/domReady!" ], function(BorderContainer, ContentPane, DataGrid, ItemFileWriteStore, dom){ // create a BorderContainer as the top widget in the hierarchy var bc = new BorderContainer({ style: "height: 500px; width: 230px;" }, "r_list"); /*set up data store*/ var data = { identifier: "id", items: [] }; data.items.push({ id: 'some_id', description: 'some_description', var store = new ItemFileWriteStore({data: data}); /*set up layout*/ var layout = [[ {'name': 'Title', 'field': 'description', 'width': '200px', 'noresize': true} ]]; /*create a new grid*/ var r_list_grid = new DataGrid({ region: "left", id: 'r_list_grid', store: store, structure: layout, rowSelector: '0px' }); bc.addChild(rt_list_grid); bc.startup(); list_grid.on("RowClick", gridRowClick); function gridRowClick(evt){ var idx = evt.rowIndex; var rowData = list_grid.getItem(idx); var r_url = rowData['url'][0]; var r_id = rowData['id'][0] require(["dojo/dom", "dojo/request/xhr", "dojo/dom-form", "dijit/layout/TabContainer", "dijit/layout/ContentPane", "dojo/ready", "dojo/domReady!"], function(dom, xhr, domForm, TabContainer, ContentPane, ready){ var url = window.location.pathname + "dev/" + r_id + "/" + r_url + "/"; xhr(url, { method: "get" }).then( function(response){ var json_response = JSON.parse(response); var fields_dict = json_response['fields_dict']; var tc = new TabContainer({ style: "height: 100%; width: 100%;" }, "r_tab_container"); for(var key in fields_dict) { var content_string = ''; var fields = fields_dict[key]; for(var field in fields) content_string += '&lt;div&gt;' + field + '&lt;/div&gt;'; var tcp = new ContentPane({ title: key, content: content_string }); tc.addChild(tcp); } tc.startup(); }, function(error){ //Error stuff } ); }); } }); &lt;/script&gt; </code></pre> <p>So what's going here and how do I fix the <strong>TabContainer</strong> formatting? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload