Customize headers in a datagrid
Trevor DeVore
lists at mangomultimedia.com
Wed Mar 17 16:42:34 EDT 2010
On Mar 17, 2010, at 3:19 PM, Ludovic Thébault wrote:
> It's work, but only if i change the script in the library.
> If i create a button in my stack, paste the script of button
> "Default Header" of stack "revDataGridLibrary" in it, change the
> script, and set the dgProp of the dataGrid to this button, the
> htmltext doesn't work : in the label of a column is see "<img
> src=200656>my label" and my image and the label.
Hmm, I just went through the steps and was able to get images
appearing in the header. Here is what I did.
1) Dragged Data Grid onto card.
2) Dragged button onto card.
3) Named button MyCustomBehavior.
4) Set button script:
set script of button "MyCustomBehavior" to script of button "Default
Header" of stack "revDataGridLibrary"
5) Update button script by changing :
setprop dgLabel pValue
set the text of field 1 of me to pValue
end dgLabel
to:
setprop dgLabel pValue
set the htmltext of field 1 of me to pValue
end dgLabel
6) Updated Data Grid property:
set the dgProp["default header behavior"] of group "DataGrid 1" to the
long id of button "MyCustomBehavior"
7) Imported an image. ID of image was 1029.
8) Opened object inspector and opened Columns pane.
9) Created two columns.
10) Set the label of column "Col 2" to:
<img src=1029>Col2
The image appeared in the header.
Can you try those steps and see if it works for you?
--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
More information about the use-livecode
mailing list