Keep Power Table Column Width after table refresh

One of my engineers recently came to me after an update to our Ignition App and said that in the newest version the widths of the columns will reset after the table is refreshed, where as before it would not.

Example with images:

After table refresh:

The table was refreshed by changing this drop down from completed to incomplete. Going from incomplete to complete causes the same issue.

image

Apparently this did not used to happen, and I'm attempting to figure out why it is happening now, since we want all of our guys to be happy with the software.

If anyone has any insights or needs any code examples of what I have I'd be more than happy to share them. I just can't find anything as far as events go, by default at least.

EDIT:
To clarify I meant column width after manually resizing with a mouse drag. I believe I can set column width manually if I need to, but I'd prefer avoiding that

EDIT 2: Another thing that I checked is that the Auto Resize Column drop down wasn't off of "off" and it is not, auto resize column is still disabled in table properties.

EDIT 3:
So, the only time that changing the information breaks it is when we are in the "all" tab for the project selectors, and the complete/incomplete drop down is used from there, which makes me think it may be part of the query for parsing all the data, instead of using the project selector drop down. I'll drop an excerpt of the query below.

SELECT ID, Complete, ... erw_reason, rw_date
															
FROM MasterFabParts2

WHERE
((('{Root Container.Project Select.selectedStringValue}' = 'ALL' AND {Root Container.ProjectComplete.selectedValue} = 1 AND Complete = 1) OR
('{Root Container.Project Select.selectedStringValue}' = 'ALL' AND {Root Container.ProjectComplete.selectedValue} = 2 AND Complete = 0) OR
('{Root Container.Project Select.selectedStringValue}' = 'ALL' AND {Root Container.ProjectComplete.selectedValue} = 0)) AND
(Part_Number LIKE '%{Root Container.PartNrSearch.text}%') AND 
(Description LIKE '%{Root Container.DescNameSearch.text}%')) OR
(((Project = '{Root Container.Project Select.selectedStringValue}' AND {Root Container.ProjectComplete.selectedValue} = 1 AND Complete = 1) OR
(Project = '{Root Container.Project Select.selectedStringValue}' AND {Root Container.ProjectComplete.selectedValue} = 2 AND Complete = 0) OR
(Project = '{Root Container.Project Select.selectedStringValue}' AND {Root Container.ProjectComplete.selectedValue} = 0)) AND
(Part_Number LIKE '%{Root Container.PartNrSearch.text}%') AND 
(Description LIKE '%{Root Container.DescNameSearch.text}%'))


Order by Part_Number

My thinking is it might be rebuilding/resizing the table because of the sheer amount of data that has to get parsed when using the 'all' selectors. Because individual projects are working fine.

I ran into the exact same problem, and no matter how I configured my power table, the columns would resize to an unusable width just about every time my query would fire.

I ended up fixing the problem by changing my msSQL query.
I changed it from: “Select […] From {…] Where […]” to: “Select TOP 250 […] From {…] Where […]”

It appears that the power table starts messing up if the dataset is above a certain size.

Any solutions on this so far? I am using Text Field as “Where….” in query to filter data , problem is every time use it ,all the column widths will be evened to same size.Thanks for all inputs.

I use the configureCell exstention function to set the column width as needed.

if not colName in ('Occurrence','Last 24','Last 8','Threshold'):
	self.setColumnWidth(colIndex,38)
elif colIndex == 0:
	self.setColumnWidth(colIndex,150)
else:
	self.setColumnWidth(colIndex,80)

As an example.

1 Like

How many rows are being returned? In my testing, the column widths didn't start goofing up until the return sizes became excessively large. I was able to address the issue by limiting the return size to 250 rows. If more than that are needed, simply add some nav buttons and a display label, so the user can iterate through all of the results with only 250 rows or less at a time. You'll have to add a custom property to store the current OFFSET, and then simply manipulate it using the buttons.

Example:

# actionPerformed event handler
# > button
table = event.source.parent('Power Table')
currentOffset = table.offset

# Prevent the new offset from exceeding the last set of numbers
newOffset = min(currentOffset + 250, table.maxReturnSize - table.maxReturnSize % 250)

table.offset = newOffset

It's been too long since I encountered this issue to remember if I was using this or not, but it does seem like something I would have tried.

10K rows returned without columns size issue when switching to power table screen, but if input anything in text field trying to filter ,it happens. Tried your way and it worked , wanted to see if there is a solution for large table.Thank you .

After applied filter, columns sizes were changed to same width again.

Thank you ,

Personally, I would consider this too much information to place on a screen at once. That's a different issue though.

Do you have the defer updates option on for this field? In other words does the filter input wait for the user to press enter, or some other input to apply the filter, or is it filtering after each key press?

1 Like

Yes, need to press Enter to activate the filter .

Also there are check boxes and Date Ranges as filters , but they do not change column widths.

so far, only the text field does

1 Like