具有动态 dojo 表单创建的 Dojo 应用程序布局
我有一个 dojo 布局,有两个内容窗格,每个窗格的高度为 50%,一个位于另一个的顶部。最上面的一个充满了道场网格。我有这个网格动态加载数据。我想用一个表单填充底部内容窗格,以编辑网格中该行的详细信息。我已成功附加 onRowClick 以动态检索该行详细信息所需的数据。
dojo.connect(grid, 'onRowClick', function(e) {
detailIssueCp.attr('href', '/rest-issue/get/id/' + e.grid._by_idx[e.rowIndex].item._id);
});
以及检测何时检索数据:
dojo.connect(detailIssueCp, 'onDownloadEnd', function(e)
{
var jsonValue = detailIssueCp.domNode.innerText;
// attempt at making a form...
}
我想构建一个格式良好的表单(例如在表格或其他内容中)并将其放置在底部内容窗格中,但我这样做的尝试最终导致行为不佳并且格式不良的表格。
有人有一个在这里有用的设计模式吗?我有一种感觉,我这样做是错误的。
I have a dojo layout with two content panes, each at 50% height, one on top of the other. The top one is filled with a dojo grid. I have this grid loading with data dynamically. I would like to populate the bottom content pane with a form to edit the details of this row in the grid. I have successfully attached the onRowClick to dynamically retrieve the data I need for the details of that row.
dojo.connect(grid, 'onRowClick', function(e) {
detailIssueCp.attr('href', '/rest-issue/get/id/' + e.grid._by_idx[e.rowIndex].item._id);
});
As well as detecting when that data has been retrieved:
dojo.connect(detailIssueCp, 'onDownloadEnd', function(e)
{
var jsonValue = detailIssueCp.domNode.innerText;
// attempt at making a form...
}
I would like to build a form that is well formatted (like in a table or something) and place it in the bottom content pane, but my attempts to do so end in poorly behaving and poorly formatted forms.
Does anyone have a design pattern that would be useful here? I have a feeling I am doing this incorrectly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来解决方案是要求 HTML 格式的表单。我试图返回一个 Json 值,而应该只从服务器请求一个完全格式化的 HTML 表单。
Well, it appears that the solution is to ask for the form in HTML format. I was trying to return a Json value and should have instead just asked for a fully formated HTML form from the server.