Missing scroll bar [message #4623] |
Thu, 13 November 2014 21:14 |
kong
Messages: 90 Registered: December 2011
|
Member |
|
|
I noticed that when you add a new entry to the $fieldarray of function _cm_changeConfig in any class, like for example: function _cm_changeConfig ($where, $fieldarray)
{
if (!isset($fieldarray['abc'])) $fieldarray['abc'] = 'anything';
return $fieldarray;
} // _cm_changeConfig
You will find that any operation on multiple records (eg. multiple selected records with enq1 or upd1, etc) of this object won't show the scroll bar. A work around is by moving the "add entry to $fieldarray" code to another function, for example _cm_getExtraData, which does not conflict with the scroll bar.
|
|
|
Re: Missing scroll bar [message #4624 is a reply to message #4623] |
Fri, 14 November 2014 04:02 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
The _cm_changeConfig() method is supposed to be used only to change the configuration of that entity, such as the contents of the $fieldspec array. Adding extra values to $fieldarray should be done in the _cm_getExtraData() method.
It is possible to add extra values in the _cm_changeConfig() method, but as it is called several times a change to the contents of $fieldarray can have different results. The first time it is called in an UPD or ENQ task is before the call to getData(), so the $where string is not empty and $fieldarray shows the primary key of the first selection. If you make a change to $fieldarray at this point this will then replace the contents of the $where string, thus replacing the multiple selection with a single selection which causes the scroll bar to be removed as there are no other selections. When _cm_changeConfig() is called after getData() the $where string will be empty and $fieldarray will show the complete contents of the current record. Any changes you make to $fieldarray at this point will not affect the scroll bars.
If you wrap your code in the following condition it will work in the _cm_changeConfig() method:
if (empty($where) AND !empty($fieldarray)) {
if (!isset($fieldarray['abc'])) $fieldarray['abc'] = 'anything';
} // if
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|