简体   繁体   English

如何使ExtJs应用程序看起来像Feed示例?

[英]How to get an ExtJs application to look like the Feed Example?

In my ExtJS Applications I have 3 components, an Ext.tree.Panel , and Ext.grid.Panel and an Ext.Img . 在我的ExtJS应用程序中,我有3个组件,一个Ext.tree.Panel ,一个Ext.grid.Panel和一个Ext.Img I want them to have the same layout as the Feed Viewer example here: 我希望它们具有与Feed Viewer示例相同的布局:

http://dev.sencha.com/deploy/ext-4.0.0/examples/feed-viewer/feed-viewer.html http://dev.sencha.com/deploy/ext-4.0.0/examples/feed-viewer/feed-viewer.html

I have been trying to look at the code but I am still having trouble getting my components to look like that (One component on the left, and two on the right one on top of the other). 我一直试图查看代码,但我仍然无法让我的组件看起来像那样(左边是一个组件,另一个组件是另一个组件)。 Can anyone explain how I can do this using 'Border' layout? 任何人都可以解释我如何使用'边框'布局来做到这一点? (Which is what it looks like they are using). (这是他们正在使用的)。

EDIT: tried creating a Nested Border Layout. 编辑:尝试创建嵌套边框布局。 The Ext.tree.Panel on the left and a Ext.tab.Panel on the right with the Ext.grid.Panel and the Ext.Img inside of it. Ext.tree.Panel左侧和Ext.tab.Panel在与右侧Ext.grid.PanelExt.Img它里面。 This causes the entire tab panel to show up blank. 这会导致整个选项卡面板显示为空白。 Code below: 代码如下:

 grid_file = Ext.create('Ext.grid.Panel', {
            title: 'File List',
            region: 'north',
            height:200,
            width:700, 
            store: store_file,
            dockedItems: [upload_toolbar],
            columns: [..]});

var imagePanel = Ext.create('Ext.Img', {
            src: 'DefaultImage',
            region: 'south',
            width: 700,
            height: 200
        });
 var tab_Panel = Ext.create('Ext.tab.Panel' , {
            width: 700,
            region: 'center',
            items: [grid_file, imagePanel]})

        win = Ext.create('Ext.window.Window', {
            title: 'ExtJS Simple File Browser',
            width: 900,
            height: 400,
            layout: 'border',
            bodyStyle: 'padding: 5px;',
            items: [tree_dir,button_panel]
        });

        win.show();

This is actually a nested border layout: 这实际上是一个嵌套的边框布局:

You have the main layout, which is border with: 你有主要的布局,边界是:

  • West: The feeds 西:饲料
  • Center: The feed info panel 中心:Feed信息面板

And the feed info panel has border layout as well with: 并且Feed信息面板还具有边框布局以及:

  • Center: The grid. 中心:网格。
  • South: The selected feed. 南:选定的饲料。

The code of the feedviewer is somewhat involved. feedviewer的代码有点牵扯。 You will probably find this more helpful. 您可能会发现更有帮助。

Submit your code if you still can't work it out. 如果仍然无法解决问题,请提交您的代码。

Open developer console in Chrome. 在Chrome中打开开发者控制台。 And check sources. 并查看来源。 They are not compressed and readable. 它们不是压缩和可读的。 :) Viewport created in FeedViewer class. :)在FeedViewer类中创建的视口。 So this is your entry point. 所以这是你的切入点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM