0

在我基于 sencha 的应用程序中,我想让 ext.list 大小取决于设备屏幕。这是我使用过的代码。

 var tab=  Ext.create('Ext.List', {
                                 width: 320,//Size wants to change depends on device display
                                 height: 290,//Size wants to change depends on device display
                                 id : 'itemList',
                                 disableSelection: true,
                                 selectedItemCls:'',
                                 itemTpl: ['<div style="margin:0px;" >'+
                                           '<table style="margin:0px;padding:0px;height:40px;" width="100%" >'+
                                           '<tr><td style="padding-left:2px;width:20%;"><span><img src="data:image/jpeg;base64,{itemImage}" height="42" width="42"/>'+
                                           '</span></td><td><span><b><font size="3">{itemName}</font></b><br>{itemDesc}</span></td>'+
                                           '<td style="padding-left:2px;width:20%;">'+
                                           '<img src="resources/img/arrow.png" onclick="viewgiftdetails(\'{itemID}\')"/>'+
                                           '</td></tr></table></div>'].join(),
                                 listeners : {
                                 itemtap: function (list, index, item, record, senchaEvent) {
                                 var data = record.getData();
                                 var itemID = data.itemID;
                                 App.gvars.itidi=data.itemID;
                                 var itemPurchased = data.itemPurchased;
                                 var imgref=data.itemImage;
                                 viewgiftdetails(itemID);
                                 Ext.getCmp('homepnl').setActiveItem({
                                                                     title: 'My item',
                                                                     items: [viewitemspnl]
                                                                     }, {type:'fade', direction:'left'});
                                 }
                                 }
                                 });

哪些代码需要更改取决于显示?

4

3 回答 3

0

I believe you should remove the width and height you have specified in list and add layout fit that should do it..

layout:'fit',
于 2013-10-23T08:39:06.977 回答
0

把 layout:'fit'.. 在那个应用程序中它会工作

于 2013-11-08T08:06:37.527 回答
0

执行layout: 'fit'列表为项目的配置对象并删除指定的高度和宽度。

于 2013-10-30T13:25:09.073 回答