Are there any known problems with showing / hiding a table column at run time?
I have a dynamic table that contains a column with a checkbox, and another column with a radio button. If the user is allowed to select more than one table row (as indicated by a form variable), then I want to show the check box column and hide the radio column. Otherwise I want to show / hide the opposite.
I am showing / hiding the column's header too. When I preview the form, however, the data in the table seems to "scoot" left and get placed into the column that is hidden, so to speak.
Here's a design view of the table:
And a run time view of the table. You can see the radio is hidden, but the "account number" column wants to squish into the (hidden) radio column,
Here's the script, I'm very confident in this little snippet of code because the account rows were populating wonderfully until I added the radio button column and the script to show /hide.
//Put the account data in the table function setAccountData(objAccountRow, objAccountItem) //pass in the row and the data to populate the row { //stuff the row
objAccountRow.accountNumber.rawValue
= objAccountItem.accountNumber; objAccountRow.accountName.rawValue
= objAccountItem.accountName; objAccountRow.accountBalance.rawValue
= objAccountItem.accountBalance;
//show the checkbox or the radio button, depending on the number of accounts they are allowed to select (as specified by the form variable)
var searchNumAccounts = objFragment.resolveNode("searchNumAccounts").value; //Form variable
if (searchNumAccounts==1) { //show the radio button column and hide the checkbox column hideObject(objResultsSubform.accounts.HeaderRow.txtSelect); <--this is overkill here, hiding the table header column for each row, ... hideObject(objAccountRow.accountSelected); showObject(objResultsSubform.accounts.HeaderRow.txtRadioSelect); showObject(objAccountRow.radioSubform.radioGroup.selected); }
else { //show the checkbox column and hide the radio column hideObject(objResultsSubform.accounts.HeaderRow.txtRadioSelect); hideObject(objAccountRow.radioSubform.radioGroup.selected); showObject(objResultsSubform.accounts.HeaderRow.txtSelect); showObject(objAccountRow.accountSelected); } }