我有一个自定义小部件:
define([
......],
function (...){
return decalre('ownerWidget', [....],{
templateString: template,
postCreate: function () {
this.inherited(arguments);
var data ={
identifier:'id',
label: 'id',
items: [{
id:'28'
owner: 'Fred',
attendingId: '1',
numberOfVisits: '3',
vetCostsThisYear: '4',
complaints: '0',
children[{
id : '29',
pet:'Mario',
numberOfVisits: '3',
vetCostsThisYear: '4',
complaints: '0'
}]
}]
};
var store = new ItemFileWriteStore({data:data});
var model = new ForestStoreModel({store : store, childrenAttrs: ['children']});
var layout = [
{name: 'Owner', field:'owner', width: '40%'},
{name: 'Pet', field: 'pet', width: '40%'},
{name: 'Attending Id', field:'attendingId', width: '5%'},
{name: 'Visits', field: 'numberOfVisits', width: '5%'}];
var gridTree = new LazyTreeGrid({
treeModel: model,
structure: layout
}, document.createElement('div'));
this.gridTreeNode.appendChild(gridTree.domNode);
}
});
});
此模板:
<div data-dojo-attach-point="gridTreeNode" style="height: 100%; width: 100%"></div>
然后在另一个小部件模板中声明小部件,如下所示:
<div class="grid" data-dojo-attach-point="byOwner" data-dojo-type="dijit/layout/ContentPane"></div>
上述声明的javascript:
this.byOwner.set('title', "Owner");
this.byOwner.set('content', "ownerWidget");
我得到一个灰色背景,标签显示正确的标题,但网格似乎没有渲染,我可以看到有一个网格的dom树,但我只是没有看到页面上的网格。 / p>
我不确定我在这里缺少什么,没有任何错误或警告。
Dojo版本1.10.0
答案 0 :(得分:0)
这是一个启动问题。
您需要在适当的时候手动启动组件(否则计算出错)。
调用>>>import pydoop.hdfs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pydoop/hdfs/__init__.py", line 79, in <module>
from fs import hdfs, default_is_local
File "pydoop/hdfs/fs.py", line 28, in <module>
hdfs_ext = pydoop.import_version_specific_module("_hdfs")
File "pydoop/__init__.py", line 114, in import_version_specific_module
return import_module(complete_mod_name(name))
File "/opt/python/dev/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _hdfs_2_2_0
方法将为您处理(参见最后一行):
placeAt