AtulDawkhare
9 Apr 2012, 7:48 AM
Hi
I am using the "itscomponentcolumn" component to display Grid with select box.
Now I want to show the Grid column depending upon the condition.
i.e. say I have 5 columns , on certain condition I want to show 3 columns or 2 columns etc
So my queries is I want to the Grid width should get atomically adjusted, so that It will look nice.
but it is not working as expected.
grid = Ext.create('Ext.grid.Panel', {
id: 'GridId',
layout:'fit',
region:'center',
store: Add_People_Store,
enableColumnMove:false,
columns: CreateGridColumns(true,true,true,true,true,true),
height: '20%',
width: '100%',
renderTo: 'My_Div'
});
And my column Code is
xtype: 'itscomponentcolumn',
text : '<b>Project</b>',
sortable:false,
width: 125,
dataIndex: 'project',
items: function(value) {
return {
xtype: 'combobox',
store: [[0,'View Only'], [1,'View & Edit'], [2,'View,Edit & Delete'],[3,'No Access'],[4,'Custom']],
displayField: 'display',
valueField: 'value',
queryMode : 'local',
forceSelection:true,
id:'project',
width: 115,
listeners: {
change: function(comboField, newValue, oldValue, eOpts)
{
AssignToHiddenComponent(newValue,this.id);
},
afterrender: function(combo) {
var recordSelected = combo.getStore().getAt(0);
if(projectValue==undefined)
combo.setValue(recordSelected.get('field1'));
else
combo.setValue(projectValue);
}
}
};
}
i.e. when I show Grid with all Columns
33783
and When due to some condition, If i want o disabled some column, my Grid show like
33785
I want the extra space should get adjusted automatically.[i.e. shown in red above]
Please suggest what is wrong here.
I am using the "itscomponentcolumn" component to display Grid with select box.
Now I want to show the Grid column depending upon the condition.
i.e. say I have 5 columns , on certain condition I want to show 3 columns or 2 columns etc
So my queries is I want to the Grid width should get atomically adjusted, so that It will look nice.
but it is not working as expected.
grid = Ext.create('Ext.grid.Panel', {
id: 'GridId',
layout:'fit',
region:'center',
store: Add_People_Store,
enableColumnMove:false,
columns: CreateGridColumns(true,true,true,true,true,true),
height: '20%',
width: '100%',
renderTo: 'My_Div'
});
And my column Code is
xtype: 'itscomponentcolumn',
text : '<b>Project</b>',
sortable:false,
width: 125,
dataIndex: 'project',
items: function(value) {
return {
xtype: 'combobox',
store: [[0,'View Only'], [1,'View & Edit'], [2,'View,Edit & Delete'],[3,'No Access'],[4,'Custom']],
displayField: 'display',
valueField: 'value',
queryMode : 'local',
forceSelection:true,
id:'project',
width: 115,
listeners: {
change: function(comboField, newValue, oldValue, eOpts)
{
AssignToHiddenComponent(newValue,this.id);
},
afterrender: function(combo) {
var recordSelected = combo.getStore().getAt(0);
if(projectValue==undefined)
combo.setValue(recordSelected.get('field1'));
else
combo.setValue(projectValue);
}
}
};
}
i.e. when I show Grid with all Columns
33783
and When due to some condition, If i want o disabled some column, my Grid show like
33785
I want the extra space should get adjusted automatically.[i.e. shown in red above]
Please suggest what is wrong here.