Jump to content


Photo

UniDbGrid AutoSize column

UniDbGrid AutoSize column autofit resize automatically

  • Please log in to reply
7 replies to this topic

#1 NelsonFS

NelsonFS

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 86 posts

Posted 16 April 2015 - 09:59 PM

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.

Attached Files


  • 0

#2 docjones

docjones

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 101 posts

Posted 21 April 2015 - 09:20 PM

how to use it ?

example will be appreciated.


  • 0

#3 zilav

zilav

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 451 posts

Posted 22 April 2015 - 06:56 AM

Like this

http://forums.unigui...age/#entry23172


  • 0

#4 fcarvalho4

fcarvalho4

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 100 posts
  • LocationLisboa

Posted 27 April 2015 - 10:33 PM

ExtEvents.reconfigure


  • 0

#5 Dieger

Dieger

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 54 posts

Posted 06 May 2015 - 07:33 PM

Hi,

 

Alternative method:

 

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

 

(Set OnCreate or OnShow event)


  • 1

#6 Nefasto Cipa

Nefasto Cipa

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 322 posts
  • LocationItaly

Posted 20 May 2015 - 08:42 AM

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 ] ?


  • 0

#7 Dieger

Dieger

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 54 posts

Posted 20 May 2015 - 12:22 PM

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

 

JSName is unique.


  • 0

#8 zanona

zanona

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 68 posts

Posted 16 October 2017 - 07:55 PM

What would be the solution for TUniMDbGrid?

 

Thanks

 

Zanona


  • 0





Also tagged with one or more of these keywords: UniDbGrid, AutoSize, column, autofit, resize, automatically

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users