Twitter bootstrap 使用引导时EXT JS 5.0中网格的隐藏列
当与引导集成时,我对ExtJS5.0有疑问。 我创建gridPanelTwitter bootstrap 使用引导时EXT JS 5.0中网格的隐藏列,twitter-bootstrap,extjs,Twitter Bootstrap,Extjs,当与引导集成时,我对ExtJS5.0有疑问。 我创建gridPanel var cellEditing = Ext.create('Ext.grid.Panel', { plugins : [Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit : 2 })], columnLines: true, // Add store
var cellEditing = Ext.create('Ext.grid.Panel', {
plugins : [Ext.create('Ext.grid.plugin.CellEditing',
{
clicksToEdit : 2
})],
columnLines: true,
// Add store
store:'ABC.store.StudentStore',
columns:[
{
xtype: 'gridcolumn',
header : 'Id',
dataIndex:'id',
hidden : false,
width : 35,
cls:'hidden-xs hidden-sm',
hideable: false
},
{
header : 'First Name',
xtype: 'numbercolumn',
dataIndex:'fName',
flex : 1,
field :
{
xtype: 'numberfield'
}
},
{
xtype: 'gridcolumn',
header : 'Middle Name',
dataIndex:'mName',
flex : 1,
editor :
{
xtype: 'textfield',
selectOnFocus: true,
allowBlank : true
}
}
],
renderTo: Ext.getBody()
}
);
在StudentStore
中,我为网格添加了一些数据。
我为列Id
设置引导的类hidden xs hidden sm
问题是:当我为小型或超小型浏览器重新调整浏览器大小时,只有标题Id
消失,但列Id
不消失。如何在为小型或超小型浏览器重新调整浏览器大小时消除列Id。
在这种情况下,请帮助我。您可以使用extjs5中的
responsive
插件根据宽度调整列
向您的插件阵列添加responsive
:
plugins: ['responsive'],
为更改列的方法定义配置
:
config: {
columnLayout: 'large'
},
为该属性添加一个setter
:
updateColumnLayout: function(size) {
switch (size) {
case 'small':
if(!this.columns[0].setVisible)
this.columns[0].hidden = true;
else
this.columns[0].setVisible(false);
break;
case 'medium':
if(!this.columns[0].setVisible)
this.columns[0].hidden = false;
else
this.columns[0].setVisible(true);
break;
case 'large':
break;
}
},
在responsiveConfig
中定义要传递给我们的setter的size
:
responsiveConfig: {
'width <= 600': {
columnLayout: 'small'
},
'width > 600': {
columnLayout: 'medium'
},
'width >= 1600': {
columnLayout: 'medium'
}
},
responsiveConfig:{
“宽度600”:{
专栏布局:“中等”
},
“宽度>=1600”:{
专栏布局:“中等”
}
},
这是一本书
我打电话给small
查询600
下的width
,打电话给medium
查询上面的所有内容。您可以根据需要调整这些参数。因为您使用的是ExtJS5,所以可以使网格响应。不能对“消失”列使用纯引导吗?