Jump to content
uniGUI Discussion Forums

Recommended Posts

sample code to resize automaticaly uniDbGrid columns:

 

thanks to Oleg by the model code.
function reconfigure(sender, store, columns, oldStore, the, eOpts)
{
  Ext.each(columns, 
     function(column, index) {
        if (!sender.columnManager) {
          sender.columns[index].flex=1;  /*fit width, comment to disable*/
          sender.columns[index].minWidth = 150; /*min.size*/
        } else {
          sender.columnManager.columns[index].flex=1; 
          sender.columnManager.columns[index].minWidth = 150; 
        };        
     }
  )
}

Demo project Attached.

uniDBGrid_Column_AutoSize.rar

Share this post


Link to post
Share on other sites

Hi,

 

Alternative method:

 

UniSession.AddJS(UniDBGridName.JSName  + '.headerCt.forceFit=true;');

 

(Set OnCreate or OnShow event)

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi,

 

Alternative method:

 

UniSession.AddJS(UniDBGridName.JSName  + '.headerCt.forceFit=true;');

 

(Set OnCreate or OnShow event)

 

Is JSName granted to be unique? Or is it safer to use FormName[ GridName ] ?

Share this post


Link to post
Share on other sites

Is JSName granted to be unique? Or is it safer to use FormName[ GridName ] ?

 

JSName is unique.

Share this post


Link to post
Share on other sites

Hi,

 

Alternative method:

 

UniSession.AddJS(UniDBGridName.JSName  + '.headerCt.forceFit=true;');

 

(Set OnCreate or OnShow event)

Error:

 

Cannot set property 'forceFit' of undefined

 

why?

Share this post


Link to post
Share on other sites

×