skafy Posted January 7, 2016 Posted January 7, 2016 How to set width of columns to automaticly fit the StringGrid. I tried function witch worked for me on DBGrid component but it doesn't work here. function columnresize(ct, column, width, eOpts){ if (column.fedit) { column.fedit.setWidth(width - 2) }} please help. Best regards Quote
Sherzod Posted January 7, 2016 Posted January 7, 2016 Hi, For now you can try this: UniStringGrid1 -> ClientEvents -> ExtEvents ... [Ext.grid.Panel] add reconfigure fn: function reconfigure(sender, store, columns, oldStore, the, eOpts) { columns.forEach(function(el){el.flex=1}) } Best regards. Quote
skafy Posted January 7, 2016 Author Posted January 7, 2016 Thank you! It works. How about text wrap in StringGrid cell? Best regards. Quote
hsn Posted February 8, 2018 Posted February 8, 2018 Hi, For now you can try this: UniStringGrid1 -> ClientEvents -> ExtEvents ... [Ext.grid.Panel] add reconfigure fn: function reconfigure(sender, store, columns, oldStore, the, eOpts) { columns.forEach(function(el){el.flex=1}) } Best regards. Hy This solution is great thank ! But i have a problem, how i can set a witdh of 1 column ? beacause its too large for just a id Thanks a lot Quote
Sherzod Posted February 8, 2018 Posted February 8, 2018 Hi,Which edition and build are you using? Try to use maxWidth for this, for example: function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns[0].maxWidth = 50; columns[1].maxWidth = 75; columns.forEach(function(el){el.flex=1}); } Best regards, 1 Quote
hsn Posted February 28, 2018 Posted February 28, 2018 Sorry, i'm new and i didn't see your response before today. It's exactly what i need thank you a lot. thanks. Quote
Administrators Farshad Mohajeri Posted February 28, 2018 Administrators Posted February 28, 2018 Please specify your uniGUI edition. Quote
rgreat Posted December 15, 2020 Posted December 15, 2020 On 2/8/2018 at 2:27 PM, Sherzod said: Try to use maxWidth for this, for example: function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns[0].maxWidth = 50; columns[1].maxWidth = 75; columns.forEach(function(el){el.flex=1}); } Can it be changed at runtime somehow, like with Unisession.AddJS? Quote
Sherzod Posted December 15, 2020 Posted December 15, 2020 3 hours ago, rgreat said: Can it be changed at runtime somehow, like with Unisession.AddJS? Hello, What exactly? Quote
rgreat Posted December 15, 2020 Posted December 15, 2020 1 hour ago, Sherzod said: Hello, What exactly? Set or edit UniStringGrid column flex,maxWidth,minWidth ExtJS properties. At runtime. Like: UniStringGrid1.Columns[3].Flex:=1; UniStringGrid1.Columns[3].maxWidth:=100; I know these properties are not available right now at server side, but maybe it could be done with JavaScript? I need to modify these settings at random time, not just at grid creation. Quote
rgreat Posted December 16, 2020 Posted December 16, 2020 Can you also check this out: Maybe you have some suggestions. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.