Copy link to clipboard
Copied
Hi there,
Working forward from the example below, taken from the ScriptUI documentation, I've created a dynamically generated dialog in InDesign CC2018.
The dialog works fine and displays the information as required.
I've tried a few things but as yet I've not been able to change the background colour of the header row.s there any way i can do this with a listbox?
I've found a few code examples using other methods, do I need to change the way the dialog is created to achieve this?
Thanks in advance.
var w = new Window ("dialog");
var myList = w.add ("listbox", undefined, " ",
{numberOfColumns: 3, showHeaders: true,
columnTitles: ["English", "French", "Dutch"]});
with (myList.add ("item", "One"))
{
subItems[0].text = "Un";
subItems[1].text = "Een";
}
with (myList.add ("item", "Two"))
{
subItems[0].text = "Deux";
subItems[1].text = "Twee";
}
with (myList.add ("item", "Three"))
{
subItems[0].text = "Trois";
subItems[1].text = "Drie";
}
w.show ();
I don't think you can change the appearance of header cells when you use 'columnTitles'. You can do that only if you define your own headers (which will then therefore be plain rows, not real header rows). The documentation you mentioned could probably do a better job of making that clear (on pp. 38 and 39).
P.
Copy link to clipboard
Copied
I don't think you can change the appearance of header cells when you use 'columnTitles'. You can do that only if you define your own headers (which will then therefore be plain rows, not real header rows). The documentation you mentioned could probably do a better job of making that clear (on pp. 38 and 39).
P.
Copy link to clipboard
Copied
Hi Peter,
Thanks for the help and confirmation.
I'd seen an example with it being a non column header row and a background colour applied.
Just wondered if I'd missed something.
I'll have another look at pages 38 & 39 of the documentation.
Thanks again.
Copy link to clipboard
Copied
On p. 40 is an example of what you were after: a non-column header row and a background colour applied.
P.
Copy link to clipboard
Copied
Thank you for the help Peter, it's much appreciated.
I've had a play around with the example on p.39. Apart from a few niggles, such as the dialog opening to the full height of the screen because of the number of items in it, I've decided to stay with the example at the top of this page.
I quite like the way I can click on a row of information and it highlights.
The dialog opens and displays the dynamically generated content ok, need to check it with more items.
One niggle I have been trying to sort is the horizontal scrolling.
I've tried a few column widths etc but the dialog always has a horizontal scrollbar? Can I turn it off?
TIA