日期:2014-05-16  浏览次数:20463 次

关于ext layout的问题,高手帮忙看看那
// create the Data Store
  var store = new Ext.data.Store({
  // load using HTTP
  url: 'sheldon.xml',
  
  // the return will be XML, so lets set up a reader
  reader: new Ext.data.XmlReader({
  // records will have an "Item" tag
  record: 'Item',
  id: 'ASIN',
  totalRecords: '@total'
  }, [
  // set up the fields mapping into the xml doc
  // The first needs mapping, the others are very basic
  {name: 'Author', mapping: 'ItemAttributes > Author'},
  'Title',
  'Manufacturer',
  'ProductGroup',
  // Detail URL is not part of the column model of the grid
  'DetailPageURL'
  ])
  });
store.load();
  var grid = new Ext.grid.GridPanel({
  store: store,
  columns: [
  {header: "Author", dataIndex: 'Author', sortable: true},
  {header: "Title",dataIndex: 'Title', sortable: true},
  {header: "Manufacturer", dataIndex: 'Manufacturer', sortable: true},
  {header: "Product Group", dataIndex: 'ProductGroup', sortable: true}
  ],
sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
viewConfig: {
forceFit: true
},
  height:210,
split: true,
region: 'north'
});  
  var ct = new Ext.Panel({
  frame: true,
  title: 'Book List',
  layout: 'border',
  items: 
  [
  grid,
  {
  id: 'detailPanel',
  region: 'south',
  bodyStyle: {
  background: '#ffffff',
  padding: '7px'
  },
  html: 'Please select a book to see additional details.111111'
  }
  ]
  })
var w2 = new Ext.Window({
title:'用户信息',
width:500,
height:600,
items:ct
})
我要把上面这个ct放进一个window里面 但是界面不出来 但是如果 单独显示ct 就可以显示 我试验了一下适应为layout的关系 如果我把ct里面的layout去掉那么window就可以显示出来了看是 显示出来的样式不对, 不是上下结构的是,所以ct里面必须要有layout,这样我就矛盾了 放了layout就显示不出,不放样式又不多,大虾帮帮忙看看吧



------解决方案--------------------
ct里加个属性:height:200