Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F884939
test_Button-programmatic.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
test_Button-programmatic.html
View Options
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<
html
>
<
head
>
<
title
>
PROGRAMMATIC - Dojo Button 100 Test
</
title
>
<
script
type
=
"text/javascript"
src
=
"../../dojo/dojo.js"
XdjConfig
=
'isDebug: true, debugAtAllCosts: true'
></
script
>
<
script
type
=
"text/javascript"
>
dojo
.
require
(
"dijit.form.Button"
);
dojo
.
require
(
"dojo.parser"
);
logMessage
=
window
.
alert
;
</
script
>
<
style
>
@
import
"../themes/tundra/tundra.css"
;
/* group multiple buttons in a row */
.
box
{
display
:
block
;
text-align
:
center
;
}
.
box
.
dojoButton
{
width
:
80
px
;
margin-right
:
10
px
;
}
.
dojoButtonContents
{
font-size
:
1.6
em
;
}
#
buttonContainer
{
border
:
1
px
solid
black
;
width
:
100
%
;
}
#
results
{
color
:
darkred
;
}
</
style
>
</
head
>
<
body
class
=
tundra
>
<
h2
>
Creating dojot.form.buttons programmatically
</
h2
>
<
h3
id
=
"results"
></
h3
>
<
div
id
=
"buttonContainer"
class
=
'box'
></
div
>
<
br
>
Pass "?count=
<
i
><
b
>
n
</
b
></
i
>
" in the query string to change the number of buttons.
<
script
type
=
"text/javascript"
>
// See if we can make a widget in script and attach it to the DOM ourselves.
function
makeEm
()
{
var
queryCount
=
location
.
search
.
match
(
/count=(\d*)/
);
var
count
=
(
queryCount
?
parseInt
(
queryCount
[
1
])
:
100
);
var
container
=
dojo
.
byId
(
"buttonContainer"
);
var
t0
=
new
Date
().
getTime
();
for
(
var
i
=
1
;
i
<=
count
;
i
++
)
{
var
it
=
new
dijit
.
form
.
Button
(
{
label
:
"Button "
+
i
,
onclick
:
'logMessage("clicked simple")'
}
);
container
.
appendChild
(
it
.
domNode
);
it
.
domNode
.
style
.
display
=
''
;
}
var
t1
=
new
Date
().
getTime
();
dojo
.
byId
(
"results"
).
innerHTML
=
"It took "
+
(
t1
-
t0
)
+
" msec to create "
+
count
+
" Buttons programmatically."
;
}
dojo
.
addOnLoad
(
makeEm
);
</
script
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sun, Apr 6, 11:24 (2 w, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25547
Default Alt Text
test_Button-programmatic.html (1 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment