PDA

View Full Version : hii all , im getting Column width problem in Ext JS



muskaan
22 Jun 2009, 10:37 PM
first time when the data is getting load in the grid its coming properly, but on moving to the next page on click of a button and then coming back to the previous page grid columns are merging together even though there width is fixed..... My code is given below ..


var store = new Century.data.SimpleStore({
fields: [
{name: 'id'},
{name: 'PlanName'},
{name: 'PlanInfo'},
{name: 'Contract'},
{name: 'Price'},
{name: 'PlanType'}
]
});
alert("here");
store.loadData(myData);
var grid = new Century.grid.GridPanel({
title:'SEARCH RESULTS',
store: store,
columns: [
{header: " ", sortable: false, width:5, dataIndex: 'id'},
{header: "Plan Name", sortable: true, autoWidth: true, dataIndex: 'PlanName'},
{header: " ", sortable: true, width:5, dataIndex: 'PlanInfo'},
{header: "Plan Type", width:20, sortable: true, dataIndex: 'PlanType'},
{header: "Contract", width:20, sortable: true, dataIndex: 'Contract'},
{header: "Price in USD",autoWidth: true, sortable: true, dataIndex: 'Price'}
],

viewConfig: {
forceFit:true },
stripeRows: true,
collapsible: true,
animCollapse: false

});

$('searchResultsDiv').innerHTML='';
grid.render('searchResultsDiv');
grid.addListener({'cellclick':
{
fn: function(grid, rowIndex, columnIndex,e )
{
if(columnIndex == 1)
{
var requesTyp = 'PlanDetails';
url ='loadProductDescription.allfon?txtProductType='+idArray[rowIndex]+'&requestType=PlanDetails';

new Ajax.Request(url,
{
method: 'post',
insertion: Insertion.Top,
parameters: $('SearchServiceForm').serialize(true),
onComplete: function(transport)
{
this.loadProductDescription(transport.responseText,requesTyp);
// create the window on the first click and reuse on subsequent clicks

}.bind(this)
});
}
}
}
,scope:this
});
});

evant
22 Jun 2009, 10:38 PM
This forum is for reporting bugs with the framework, if you're asking for help please post in the help forum, moving this.

umarkashmiri
22 Jun 2009, 10:47 PM
first time when the data is getting load in the grid its coming properly, but on moving to the next page on click of a button and then coming back to the previous page grid columns are merging together even though there width is fixed..... My code is given below ..


var store = new Century.data.SimpleStore({
fields: [
{name: 'id'},
{name: 'PlanName'},
{name: 'PlanInfo'},
{name: 'Contract'},
{name: 'Price'},
{name: 'PlanType'}
]
});
alert("here");
store.loadData(myData);
var grid = new Century.grid.GridPanel({
title:'SEARCH RESULTS',
store: store,
columns: [
{header: " ", sortable: false, width:5, dataIndex: 'id'},
{header: "Plan Name", sortable: true, autoWidth: true, dataIndex: 'PlanName'},
{header: " ", sortable: true, width:5, dataIndex: 'PlanInfo'},
{header: "Plan Type", width:20, sortable: true, dataIndex: 'PlanType'},
{header: "Contract", width:20, sortable: true, dataIndex: 'Contract'},
{header: "Price in USD",autoWidth: true, sortable: true, dataIndex: 'Price'}
],

viewConfig: {
forceFit:true },
stripeRows: true,
collapsible: true,
animCollapse: false

});

$('searchResultsDiv').innerHTML='';
grid.render('searchResultsDiv');
grid.addListener({'cellclick':
{
fn: function(grid, rowIndex, columnIndex,e )
{
if(columnIndex == 1)
{
var requesTyp = 'PlanDetails';
url ='loadProductDescription.allfon?txtProductType='+idArray[rowIndex]+'&requestType=PlanDetails';

new Ajax.Request(url,
{
method: 'post',
insertion: Insertion.Top,
parameters: $('SearchServiceForm').serialize(true),
onComplete: function(transport)
{
this.loadProductDescription(transport.responseText,requesTyp);
// create the window on the first click and reuse on subsequent clicks

}.bind(this)
});
}
}
}
,scope:this
});
});


if u ve set forcefit:true then width is the min width so need to add width

muskaan
22 Jun 2009, 10:51 PM
even adding width value is not solving the problem...

umarkashmiri
22 Jun 2009, 11:14 PM
even adding width value is not solving the problem...
Then attach the load listener and column resize events and check the new and old withs... in this listener call the setwidth function of column model and set the width again .......... do this only if u are unable to find any other reason.............got my point

Umar Kashmiri
SE,CTO 24/7
Pvt.Ltd.
Pakistan

muskaan
23 Jun 2009, 1:51 AM
thanx Umar its working now.. :)