extjs4 - Extjs : Grid column width in percentage -


looks not 1 has run situation. need set widths of columns in grid panel in percentages on size (due resizing) each column has predefined percentage width. not able achieve setting width : 'xy%' on each column. noticed same question being asked in below threads. http://www.sencha.com/forum/showthread.php?138485 http://www.sencha.com/forum/showthread.php?92930

this didnot either : how set width in ext.grid.columnmodel in percentage terms?

note : donot want flex columns, want set percentages.

extjs gurus please shed light!

the other question you've linked relates previous version of ext, not ext 4. flex option you're looking for... you're not limited set integers, , flexed columns width respect ratio between flex value.

furthermore, can explicitly convey idea of percentage using fraction of 100.

here's example:

ext.create('ext.grid.panel', {     title: "resize me!",     // ratios kept when grid resized.     resizable: true,     columns: {         // if want guarantee columns keep         // given ratios, must prevent user         // resizing them.         defaults: {             resizable: false         },         items: [{             text: 'name',             dataindex: 'name',             flex: 25 / 100         }, {             text: 'email',             dataindex: 'email',             flex: 25 / 100         }, {             text: 'phone',             dataindex: 'phone',             flex: 50 / 100         }]     },     height: 200,     width: 400,     renderto: ext.getbody(),     store: {         fields: ['name', 'email', 'phone'],         data: [{             'name': 'lisa',             "email": "lisa@simpsons.com",             "phone": "555-111-1224"         }, {             'name': 'bart',             "email": "bart@simpsons.com",             "phone": "555-222-1234"         }, {             'name': 'homer',             "email": "home@simpsons.com",             "phone": "555-222-1244"         }, {             'name': 'marge',             "email": "marge@simpsons.com",             "phone": "555-222-1254"         }]     } }); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -