Dojo 1.6의 사용자 정의 위젯에서 데이터 격자를 생성하려하지만 DataGrid에 해당하는 HTML 만 생성되고 Grid에는 데이터가 채워지지 않습니다. 이 HTML은 위의 코드에 의해 생성되는Dojo DataGrid가 사용자 정의 위젯의 데이터를 채우지 않음
<div>
<div id="dummy"></div>
</div>
: - - :
여기dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.parser");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.declare("FormGenerator", [dijit._Widget, dijit._Templated], {
widgetsInTemplate: true,
templateString: dojo.cache("widget", "templates/dummyHTML.html"),
postCreate : function(){
this.inherited(arguments);
layout =
[
{ name: 'Name', field: 'name', width: '100px' },
{ name: 'Color', field: 'color', width: '100px' }
];
dataStore = {
data :
{items :[
{ name : 'John Doe', color: 'green' },
{ name : 'Jane Doe', color: 'red' }
],
label:'name',
identifier:'color'
}
};
var grid = new dojox.grid.DataGrid
(
{
store: new dojo.data.ItemFileReadStore(window.dataStore),
autoRender : true,
structure: window.layout
},
"dummy" // this id should be there in HTML .
);
grid.startup();
},
});
dummyHTML.html 템플릿입니다 -이 : 여기
사용자 정의 위젯 코드<div id="formRequirement" widgetid="formRequirement">
<div align="left" dojoattachevent="onmouseout:_mouseOut" role="grid" hidefocus="hidefocus" tabindex="0" aria-multiselectable="true" class="dojoxGrid" id="dummy" widgetid="dummy" aria-readonly="true" style="height: 0px; -moz-user-select: none;">
<div role="presentation" dojoattachpoint="viewsHeaderNode" class="dojoxGridMasterHeader" style="display: none; height: 0px;"><div role="presentation" dojoattachpoint="headerNode" class="dojoxGridHeader" style="width: 1270px; left: 1px; top: 0pt;">
<div role="presentation" style="width: 9000em;" dojoattachpoint="headerNodeContainer">
<div role="row" dojoattachpoint="headerContentNode">
<table cellspacing="0" cellpadding="0" border="0" role="presentation" class="dojoxGridRowTable">
<tbody><tr>
<th dndtype="gridColumn_dummy" style="width: 100px;" idx="0" class="dojoxGridCell dojoDndItem " id="dummyHdr0" role="columnheader" aria-readonly="true" tabindex="-1">
<div class="dojoxGridSortNode">Name</div>
</th>
<th dndtype="gridColumn_dummy" style="width: 100px;" idx="1" class="dojoxGridCell dojoDndItem " id="dummyHdr1" role="columnheader" aria-readonly="true" tabindex="-1"><div class="dojoxGridSortNode">Color</div></th>
</tr>
</tbody>
</table>
</div>
</div>
</div></div>
<div role="presentation" dojoattachpoint="viewsNode" class="dojoxGridMasterView"><div role="presentation" class="dojoxGridView" id="dojox_grid__View_1" widgetid="dojox_grid__View_1" style="width: 1270px; height: 0px; left: 1px; top: 0px;">
<input type="checkbox" role="presentation" dojoattachpoint="hiddenFocusNode" class="dojoxGridHiddenFocus">
<input type="checkbox" role="presentation" class="dojoxGridHiddenFocus">
<div role="presentation" dojoattachpoint="scrollboxNode" class="dojoxGridScrollbox" style="height: 0px;">
<div role="presentation" hidefocus="hidefocus" dojoattachpoint="contentNode" class="dojoxGridContent" style="height: 64px; width: 1255px;"></div>
</div>
</div></div>
<div dojoattachpoint="messagesNode" style="display: none;" class="dojoxGridMasterMessages"></div>
<span tabindex="0" dojoattachpoint="lastFocusNode"></span>
</div>
</div>
위의 코드는 데이터를 채우지 않는 것을 볼 수 있습니다. 또한 레이아웃 및 데이터 저장소를 전역 변수로 만들었지 만 성공하지 못했음을 알 수 있습니다. 심지어 나는 DataGrid를 Template 파일 (dummyHTML.html)에 넣고 Markup에 의해 DataGrid를 초기화하려고했지만 작동하지도 않았다.
나는 무엇이 있는지 놓치고 말해줘.
감사합니다.