Jump to content

Recommended Posts

Posted

Add on MainForm.Script

 

function OnGridResize(sender, adjWidth, lastColNotResize)

{

var TotWidth=0, VarWidth=0, ResizableColumnCount=0, i1=0, i2=0,

colModel=sender.getColumnModel();

lastColNotResize=lastColNotResize||0;

if (lastColNotResize>0) {i2=lastColNotResize}

else {i1=-lastColNotResize};

for(i=1;i<colModel.columns.length;i++)

{TotWidth+=colModel.columns.width;

ResizableColumnCount++;}

TotWidth+=colModel.columns.length;

VarWidth=adjWidth-TotWidth;

if ((ResizableColumnCount-i1-i2)>0){VarWidth=VarWidth/(ResizableColumnCount-i1-i2)}

for(i=1+i1;i<colModel.columns.length-i2;i++)

{colModel.setColumnWidth(i, colModel.columns.width+VarWidth)}

}

 

and

 

Add on unidbgrid.ClientEvents

 

function OnReconfigure(sender, store, colModel)

{

OnGridResize(sender, sender.width, 3);

}

and

 

function OnResize(sender, adjWidth, adjHeight, rawWidth, rawHeight)

{

OnGridResize(sender, adjWidth, 3);

}

Posted

Great! but if "forceFit" there why not use it?

 

 

 

Add on MainForm.Script

 

function OnGridResize(sender, adjWidth, lastColNotResize)

{

var TotWidth=0, VarWidth=0, ResizableColumnCount=0, i1=0, i2=0,

colModel=sender.getColumnModel();

lastColNotResize=lastColNotResize||0;

if (lastColNotResize>0) {i2=lastColNotResize}

else {i1=-lastColNotResize};

for(i=1;i<colModel.columns.length;i++)

{TotWidth+=colModel.columns.width;

ResizableColumnCount++;}

TotWidth+=colModel.columns.length;

VarWidth=adjWidth-TotWidth;

if ((ResizableColumnCount-i1-i2)>0){VarWidth=VarWidth/(ResizableColumnCount-i1-i2)}

for(i=1+i1;i<colModel.columns.length-i2;i++)

{colModel.setColumnWidth(i, colModel.columns.width+VarWidth)}

}

 

and

 

Add on unidbgrid.ClientEvents

 

function OnReconfigure(sender, store, colModel)

{

OnGridResize(sender, sender.width, 3);

}

and

 

function OnResize(sender, adjWidth, adjHeight, rawWidth, rawHeight)

{

OnGridResize(sender, adjWidth, 3);

}

  • 7 months later...
Posted

Hi. 

You can make so:
 

function OnReconfigure(sender, store, colModel)
{
sender.headerCt.forceFit=true;
}

 

 

on unidbgrid.ClientEvents.ExtEvents

  • 3 weeks later...
Posted

also

for certain columns you can make, for example:

 

function OnReconfigure(sender, store, colModel)
{var col;

if (!sender.columnManager) {
col=sender.columns;
} else {
col=sender.columnManager.columns;
}
col[0].flex=1;
col[2].flex=1;
col[5].flex=1;

}

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...