Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting values in listbox DTC

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
What is the syntax for the listbox.setValue method?
 

The syntax is:
ListBox1.setValue value,index

index is zero based and optional. If left empty, the method applies to currently selected index.

 
Makes sense. But what is the need for the index part? I'm already telling it which listbox to touch. Is the index a reference to a value or something?
 

Index helps you set the value of any item in the listbox you choose and not necessarily the currently selected item.
for example, if you have 5 items in your listbox, index goes from 0 to 4 referencing different values in the listbox, from the first to the last item in the listbox.

by the way, is your editable grid working all right now?
 
It's always worked once I did everything Merlin told me to. It's pretty cool, except it's too darn wide. I wish I could getr the same funcionality using a nicely grouped set of DTC's in a table that was no wider than a regular page.
 
Grid Width:
Try adding invisible-gifs to the header row with height of 1 and width as required.
This may be most easily (automatically) applied to the Grid DTC code in _ScriptLibrary. All columns supply a width (unless you un-tick the fixed width option). You can find the Display routine of the grid, and in the loop that generates the title row, add an image to each column:
'<IMG SRC=&quot;/img/inv.gif&quot; ' + this.headerWidth[nCol] + ' HEIGHT=1 BORDER=&quot;0&quot; VSPACE=0 HSPACE=0><BR>'
followed by the actual title text. The this.headerWidth array includes the 'WIDTH=' text.

function _DG_display(...)
...
strHTML += '<TH ' + this.headerWidth[nCol] + '>'
+ '<IMG SRC=&quot;/img/inv.gif&quot; ' + this.headerWidth[nCol] + ' HEIGHT=1 BORDER=&quot;0&quot; VSPACE=0 HSPACE=0><BR>'
+ this.headerFormat
+ strValue
+ '</TH>\n';

remeber to create an invisible gif of 1x1 dimension with a see-through colour.

Now the design-time width settings will (hopefully) be observed exactly. Tell me if it works!!! (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top