| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 |
<title>Data-bound Form element Kitchen Sink test</title> |
| 6 |
<style type="text/css"> |
| 7 |
@import "css/app-format.css"; |
| 8 |
@import "../../../dijit/themes/claro/claro.css"; |
| 9 |
label { |
| 10 |
text-align: left; |
| 11 |
width: 100%; |
| 12 |
} |
| 13 |
</style> |
| 14 |
<script type="text/javascript" data-dojo-config="parseOnLoad:1,isDebug:1,async:1,mvc:{debugBindings:1}" src="../../../dojo/dojo.js"></script> |
| 15 |
<script type="text/javascript"> |
| 16 |
|
| 17 |
var store, selctrl, decselctrl, numspinctrl; |
| 18 |
var filctrl, decfilctrl; |
| 19 |
var comboctrl, deccomboctrl; |
| 20 |
var datectrl, decdatectrl; |
| 21 |
var sliderctrl, decsliderctrl; |
| 22 |
var numspinctrl, decnumspinctrl; |
| 23 |
var simpTActrl, decsimpTActrl; |
| 24 |
var textareactrl, dectextareactrl; |
| 25 |
var deccalctrl, deccolorctrl; |
| 26 |
|
| 27 |
require([ |
| 28 |
'dojo/_base/kernel', |
| 29 |
"dojo/_base/declare", |
| 30 |
'dojo/parser', |
| 31 |
'dojo/ready', |
| 32 |
'dojox/mvc', |
| 33 |
'dojox/mvc/at', |
| 34 |
'dijit/_WidgetBase', |
| 35 |
'dijit/form/TextBox', |
| 36 |
'dijit/form/Button', |
| 37 |
'dijit/form/Select', |
| 38 |
'dijit/form/FilteringSelect', |
| 39 |
'dijit/form/ComboBox', |
| 40 |
'dijit/form/DateTextBox', |
| 41 |
'dijit/form/HorizontalSlider', |
| 42 |
'dijit/form/NumberSpinner', |
| 43 |
'dijit/form/SimpleTextarea', |
| 44 |
'dijit/form/Textarea', |
| 45 |
'dojo/data/ItemFileReadStore', |
| 46 |
"dojo/Stateful", |
| 47 |
"dojox/mvc/getStateful", |
| 48 |
"dojox/mvc/EditModelRefController", |
| 49 |
'dijit/Calendar', |
| 50 |
'dijit/ColorPalette', |
| 51 |
'dojox/mvc/Group', |
| 52 |
'dojox/mvc/Output', |
| 53 |
'dojo/date/locale' |
| 54 |
], function(kernel, declare, parser, ready, mvc, at, _WidgetBase, TextBox, Button, Select, FilteringSelect, ComboBox, DateTextBox, |
| 55 |
HorizontalSlider, NumberSpinner, SimpleTextarea, Textarea, ItemFileReadStore, Stateful, getStateful, EditModelRefController, |
| 56 |
Calendar, ColorPalette){ |
| 57 |
//window.at = at; |
| 58 |
|
| 59 |
var alreadyset = false; |
| 60 |
var data = [ |
| 61 |
{id: '1',name:"one"}, |
| 62 |
{id: '2',name:"two"}, |
| 63 |
{id: '3',name:"three"}, |
| 64 |
{id: '4',name:"four"}, |
| 65 |
{id: '5',name:"five"}, |
| 66 |
{id: '6',name:"six"}, |
| 67 |
{id: '7',name:"seven"}, |
| 68 |
{id: '8',name:"eight"}, |
| 69 |
{id: '9',name:"nine"}, |
| 70 |
{id: '10',name:"ten"}, |
| 71 |
{id: '11',name:"eleven"}, |
| 72 |
{id: '12',name:"twelve"}, |
| 73 |
{id: '13',name:"thirteen"} |
| 74 |
]; |
| 75 |
store = new ItemFileReadStore({ |
| 76 |
data: { |
| 77 |
identifier: 'id', |
| 78 |
label: 'name', |
| 79 |
items: data |
| 80 |
} |
| 81 |
}); |
| 82 |
|
| 83 |
var data2 = { |
| 84 |
identifier: "value", |
| 85 |
label: "label", |
| 86 |
items: [ |
| 87 |
{value: "1", label: "one"}, |
| 88 |
{value: "2", label: "two"}, |
| 89 |
{value: "3", label: "three"}, |
| 90 |
{value: "4", label: "four"}, |
| 91 |
{value: "5", label: "five"}, |
| 92 |
{value: "6", label: "six"}, |
| 93 |
{value: "7", label: "seven"}, |
| 94 |
{value: "8", label: "eigth"}, |
| 95 |
{value: "9", label: "nine"}, |
| 96 |
{value: "10", label: "ten"}, |
| 97 |
{value: "11", label: "eleven"}, |
| 98 |
{value: "12", label: "twelve"}, |
| 99 |
{value: "13", label: "thirteen"}, |
| 100 |
{value: "14", label: "fourteen"} |
| 101 |
] |
| 102 |
}; |
| 103 |
|
| 104 |
selctrl = new EditModelRefController({sourceModel: new Stateful({number: "1"})}); |
| 105 |
decselctrl = new EditModelRefController({sourceModel: new Stateful({number: "1"})}); |
| 106 |
|
| 107 |
// create models for filtering selects |
| 108 |
filctrl = new EditModelRefController({sourceModel: new Stateful({number: "2"})}); |
| 109 |
decfilctrl = new EditModelRefController({sourceModel: new Stateful({number: "2"})}); |
| 110 |
|
| 111 |
// create models for ComboBoxes |
| 112 |
comboctrl = new EditModelRefController({sourceModel: new Stateful({number: "three"})}); |
| 113 |
deccomboctrl = new EditModelRefController({sourceModel: new Stateful({number: "three"})}); |
| 114 |
|
| 115 |
// create a model for DateTextBox |
| 116 |
datectrl = new EditModelRefController({sourceModel: new Stateful({number: "2011-04-04"})}); |
| 117 |
decdatectrl = new EditModelRefController({sourceModel: new Stateful({number: "2011-04-04"})}); |
| 118 |
|
| 119 |
// create a model for Slider |
| 120 |
sliderctrl = new EditModelRefController({sourceModel: new Stateful({number: "5"})}); |
| 121 |
decsliderctrl = new EditModelRefController({sourceModel: new Stateful({number: "5"})}); |
| 122 |
|
| 123 |
// create a model for NumberSpinner |
| 124 |
numspinctrl = new EditModelRefController({sourceModel: new Stateful({number: "6"})}); |
| 125 |
decnumspinctrl = new EditModelRefController({sourceModel: new Stateful({number: "6"})}); |
| 126 |
|
| 127 |
// create a model for SimpleTextArea |
| 128 |
simpTActrl = new EditModelRefController({sourceModel: new Stateful({number: "7"})}); |
| 129 |
decsimpTActrl = new EditModelRefController({sourceModel: new Stateful({number: "7"})}); |
| 130 |
|
| 131 |
// create a model for TextArea |
| 132 |
textareactrl = new EditModelRefController({sourceModel: new Stateful({number: "8"})}); |
| 133 |
dectextareactrl = new EditModelRefController({sourceModel: new Stateful({number: "8"})}); |
| 134 |
|
| 135 |
// create a model for dijit.Calendar |
| 136 |
deccalctrl = new EditModelRefController({sourceModel: new Stateful({date: "Mon Apr 04 2011 01:00:00 GMT-0400 (Eastern Daylight Time)"})}); |
| 137 |
|
| 138 |
// create a model for dijit.ColorPalette |
| 139 |
deccolorctrl = new EditModelRefController({sourceModel: new Stateful({code: "#000000"})}); |
| 140 |
|
| 141 |
// Handle the programmatic creation of widgets here: |
| 142 |
|
| 143 |
// create the select, textbox, output and button |
| 144 |
var sel = new Select({ |
| 145 |
store: store, |
| 146 |
loadChildrenOnOpen: true, |
| 147 |
// value: 1, |
| 148 |
value: at(selctrl, 'number') // bind to model.number |
| 149 |
}, document.getElementById('sel')); |
| 150 |
|
| 151 |
var text = new TextBox({ |
| 152 |
//id: "seltext", |
| 153 |
value: at(selctrl, 'number') // bind to model.number |
| 154 |
}, document.getElementById('seltext')); |
| 155 |
text.startup(); |
| 156 |
|
| 157 |
var selOutput = new mvc.Output({ |
| 158 |
value: at(selctrl, 'number') // bind to model.number |
| 159 |
}, document.getElementById('selOutput')); |
| 160 |
selOutput.startup(); |
| 161 |
|
| 162 |
var reset1 = new Button({ |
| 163 |
onClick: function(){ selctrl.reset(); }, |
| 164 |
id: "selReset", |
| 165 |
label: "Reset" |
| 166 |
}, document.getElementById('reset1')); |
| 167 |
reset1.startup(); |
| 168 |
|
| 169 |
|
| 170 |
sel.watch('value', function () { |
| 171 |
//console.log('sel value changed', arguments); |
| 172 |
}); |
| 173 |
|
| 174 |
text.watch('value', function () { |
| 175 |
//console.log('text value changed', arguments); |
| 176 |
}); |
| 177 |
|
| 178 |
sel.startup(); |
| 179 |
|
| 180 |
|
| 181 |
// create the filtering select, textbox, output and button |
| 182 |
var filsel = new FilteringSelect({ |
| 183 |
store: store, |
| 184 |
value: at(filctrl,'number') // bind to ctrl.number |
| 185 |
}, document.getElementById('filsel')); |
| 186 |
filsel.startup(); |
| 187 |
|
| 188 |
var filtext = new TextBox({ |
| 189 |
value: at(filctrl,'number') // bind to ctrl.number |
| 190 |
}, document.getElementById('filtext')); |
| 191 |
filtext.startup(); |
| 192 |
|
| 193 |
var filoutput = new mvc.Output({ |
| 194 |
value: at(filctrl,'number') // bind to ctrl.number |
| 195 |
}, document.getElementById('filoutput')); |
| 196 |
filoutput.startup(); |
| 197 |
|
| 198 |
var filreset = new Button({ |
| 199 |
onClick: function(){filctrl.reset();}, |
| 200 |
id: "filReset", |
| 201 |
label: "Reset" |
| 202 |
}, document.getElementById('filreset')); |
| 203 |
filreset.startup(); |
| 204 |
|
| 205 |
|
| 206 |
// create the comboBox, textbox, output and button |
| 207 |
var combo = new ComboBox({ |
| 208 |
store: store, |
| 209 |
value: at(comboctrl, 'number') // bind to ctrl.number |
| 210 |
}, document.getElementById('combosel')); |
| 211 |
|
| 212 |
var combotext = new TextBox({ |
| 213 |
value: at(comboctrl, 'number') |
| 214 |
}, document.getElementById('combotext')); |
| 215 |
|
| 216 |
var combooutput = new mvc.Output({ |
| 217 |
value: at(comboctrl, 'number') |
| 218 |
}, document.getElementById('combooutput')); |
| 219 |
combooutput.startup(); |
| 220 |
|
| 221 |
var comboreset = new Button({ |
| 222 |
onClick: function(){comboctrl.reset();}, |
| 223 |
id: "comboReset", |
| 224 |
label: "Reset" |
| 225 |
}, document.getElementById('comboreset')); |
| 226 |
comboreset.startup(); |
| 227 |
|
| 228 |
combotext.startup(); |
| 229 |
combo.startup(); |
| 230 |
|
| 231 |
// create the dijit.form.DateTextBox, textbox, output and button |
| 232 |
var dateWid = new DateTextBox({ |
| 233 |
value: at(datectrl, 'number') // bind to ctrl.number |
| 234 |
}, document.getElementById('datesel')); |
| 235 |
|
| 236 |
var datetext = new TextBox({ |
| 237 |
value: at(datectrl, 'number') |
| 238 |
}, document.getElementById('datetext')); |
| 239 |
|
| 240 |
var dateoutput = new mvc.Output({ |
| 241 |
value: at(datectrl, 'number') |
| 242 |
}, document.getElementById('dateoutput')); |
| 243 |
dateoutput.startup(); |
| 244 |
|
| 245 |
var datereset = new Button({ |
| 246 |
onClick: function(){datectrl.reset();}, |
| 247 |
id: "dateReset", |
| 248 |
label: "Reset" |
| 249 |
}, document.getElementById('datereset')); |
| 250 |
datereset.startup(); |
| 251 |
|
| 252 |
datetext.startup(); |
| 253 |
dateWid.startup(); |
| 254 |
|
| 255 |
// create the dijit.form.HorizontalSlider, textbox, output and button |
| 256 |
var sliderWid = new HorizontalSlider({ |
| 257 |
style:{width:"190px"}, |
| 258 |
minimum:0, |
| 259 |
maximum:100, |
| 260 |
discreteValues:21, |
| 261 |
value: at(sliderctrl, 'number') // bind to ctrl.number |
| 262 |
}, document.getElementById('slidersel')); |
| 263 |
|
| 264 |
var slidertext = new TextBox({ |
| 265 |
value: at(sliderctrl, 'number') |
| 266 |
}, document.getElementById('slidertext')); |
| 267 |
|
| 268 |
var slideroutput = new mvc.Output({ |
| 269 |
value: at(sliderctrl, 'number') |
| 270 |
}, document.getElementById('slideroutput')); |
| 271 |
slideroutput.startup(); |
| 272 |
|
| 273 |
var sliderreset = new Button({ |
| 274 |
onClick: function(){sliderctrl.reset();}, |
| 275 |
id: "sliderReset", |
| 276 |
label: "Reset" |
| 277 |
}, document.getElementById('sliderreset')); |
| 278 |
sliderreset.startup(); |
| 279 |
|
| 280 |
slidertext.startup(); |
| 281 |
sliderWid.startup(); |
| 282 |
|
| 283 |
// create the dijit.form.NumberSpinner, textbox, output and button |
| 284 |
var numspinWid = new NumberSpinner({ |
| 285 |
// constraints:{max:100,places:0}, |
| 286 |
value: at(numspinctrl, 'number') // bind to ctrl.number |
| 287 |
}, document.getElementById('numspinsel')); |
| 288 |
|
| 289 |
var numspintext = new TextBox({ |
| 290 |
value: at(numspinctrl, 'number') |
| 291 |
}, document.getElementById('numspintext')); |
| 292 |
|
| 293 |
var numspinoutput = new mvc.Output({ |
| 294 |
value: at(numspinctrl, 'number') |
| 295 |
}, document.getElementById('numspinoutput')); |
| 296 |
numspinoutput.startup(); |
| 297 |
|
| 298 |
var numspinreset = new Button({ |
| 299 |
onClick: function(){numspinctrl.reset();}, |
| 300 |
id: "numspinReset", |
| 301 |
label: "Reset" |
| 302 |
}, document.getElementById('numspinreset')); |
| 303 |
numspinreset.startup(); |
| 304 |
|
| 305 |
numspintext.startup(); |
| 306 |
numspinWid.startup(); |
| 307 |
|
| 308 |
// create the dijit.form.SimpleTextarea, textbox, output and button |
| 309 |
var simpTAWid = new SimpleTextarea({ |
| 310 |
style:{height:"20px", width:"180px"}, |
| 311 |
value: at(simpTActrl, 'number') // bind to ctrl.number |
| 312 |
}, document.getElementById('simpTAsel')); |
| 313 |
|
| 314 |
var simpTAtext = new TextBox({ |
| 315 |
value: at(simpTActrl, 'number') |
| 316 |
}, document.getElementById('simpTAtext')); |
| 317 |
|
| 318 |
var simpTAoutput = new mvc.Output({ |
| 319 |
value: at(simpTActrl, 'number') |
| 320 |
}, document.getElementById('simpTAoutput')); |
| 321 |
simpTAoutput.startup(); |
| 322 |
|
| 323 |
var simpTAreset = new Button({ |
| 324 |
onClick: function(){simpTActrl.reset();}, |
| 325 |
id: "simpTAReset", |
| 326 |
label: "Reset" |
| 327 |
}, document.getElementById('simpTAreset')); |
| 328 |
simpTAreset.startup(); |
| 329 |
|
| 330 |
simpTAtext.startup(); |
| 331 |
simpTAWid.startup(); |
| 332 |
|
| 333 |
// create the dijit.form.Textarea, textbox, output and button |
| 334 |
var textareaWid = new Textarea({ |
| 335 |
// constraints:{max:100,places:0}, |
| 336 |
value: at(textareactrl, 'number') // bind to ctrl.number |
| 337 |
}, document.getElementById('textareasel')); |
| 338 |
|
| 339 |
var textareatext = new TextBox({ |
| 340 |
value: at(textareactrl, 'number') |
| 341 |
}, document.getElementById('textareatext')); |
| 342 |
|
| 343 |
var textareaoutput = new mvc.Output({ |
| 344 |
value: at(textareactrl, 'number') |
| 345 |
}, document.getElementById('textareaoutput')); |
| 346 |
textareaoutput.startup(); |
| 347 |
|
| 348 |
var textareareset = new Button({ |
| 349 |
onClick: function(){textareactrl.reset();}, |
| 350 |
id: "textareaReset", |
| 351 |
label: "Reset" |
| 352 |
}, document.getElementById('textareareset')); |
| 353 |
textareareset.startup(); |
| 354 |
|
| 355 |
textareatext.startup(); |
| 356 |
textareaWid.startup(); |
| 357 |
|
| 358 |
}); |
| 359 |
|
| 360 |
</script> |
| 361 |
</head> |
| 362 |
<body class="claro"> |
| 363 |
<script type="dojo/require">at: "dojox/mvc/at"</script> |
| 364 |
<div id="wrapper"> |
| 365 |
<div id="header" style="margin-top: 0px;"> |
| 366 |
<div id="navigation" style="margin-top: 0px;"></div> |
| 367 |
<div id="headerInsert" style="margin-top: 0px;"> |
| 368 |
<h2>Data-bound Form Element Kitchen Sink MVC test</h2> |
| 369 |
</div> |
| 370 |
</div> |
| 371 |
<div id="main" style="margin-top: 0px;"> |
| 372 |
<div id="leftNav"></div> |
| 373 |
<div id="mainContent"> |
| 374 |
|
| 375 |
<h2 style="margin-top: 0px;">Programmatic creation of Form elements:</h2> |
| 376 |
<table> |
| 377 |
<tbody> |
| 378 |
<tr> |
| 379 |
<td><label>Widget</label></td> |
| 380 |
<td><label></label></td> |
| 381 |
<td><label>Textbox</label></td> |
| 382 |
<td><label>Output</label></td> |
| 383 |
<td><label>Model Reset</label></td> |
| 384 |
</tr> |
| 385 |
<tr> |
| 386 |
<td><label for="sel">Select:</label></td> |
| 387 |
<td><div id="sel"></div></td> |
| 388 |
<td><div id="seltext"></div></td> |
| 389 |
<td><div id="selOutput"></div></td> |
| 390 |
<td><div id="reset1" ></div></td> |
| 391 |
</tr> |
| 392 |
<tr> |
| 393 |
<td><label for="filsel">FilteringSelect:</label></td> |
| 394 |
<td><div id="filsel"></div></td> |
| 395 |
<td><div id="filtext"></div></td> |
| 396 |
<td><div id="filoutput"></div></td> |
| 397 |
<td><div id="filreset"></div></td> |
| 398 |
</tr> |
| 399 |
<tr> |
| 400 |
<td><label for="combosel">ComboBox:</label></td> |
| 401 |
<td><div id="combosel"></div></td> |
| 402 |
<td><div id="combotext"></div></td> |
| 403 |
<td><div id="combooutput"></div></td> |
| 404 |
<td><div id="comboreset"></div></td> |
| 405 |
</tr> |
| 406 |
<tr> |
| 407 |
<td><label for="datesel">DateTextBox:</label></td> |
| 408 |
<td><div id="datesel"></div></td> |
| 409 |
<td><div id="datetext"></div></td> |
| 410 |
<td><div id="dateoutput"></div></td> |
| 411 |
<td><div id="datereset"></div></td> |
| 412 |
</tr> |
| 413 |
<tr> |
| 414 |
<td><label for="slidersel">Slider:</label></td> |
| 415 |
<td><div id="slidersel"></div></td> |
| 416 |
<td><div id="slidertext"></div></td> |
| 417 |
<td><div id="slideroutput"></div></td> |
| 418 |
<td><div id="sliderreset"></div></td> |
| 419 |
</tr> |
| 420 |
<tr> |
| 421 |
<td><label for="numspinsel">NumberSpinner:</label></td> |
| 422 |
<td><div id="numspinsel"></div></td> |
| 423 |
<td><div id="numspintext"></div></td> |
| 424 |
<td><div id="numspinoutput"></div></td> |
| 425 |
<td><div id="numspinreset"></div></td> |
| 426 |
</tr> |
| 427 |
<tr> |
| 428 |
<td><label for="simpTAsel">SimpleTextArea:</label></td> |
| 429 |
<td><div id="simpTAsel"></div></td> |
| 430 |
<td><div id="simpTAtext"></div></td> |
| 431 |
<td><div id="simpTAoutput"></div></td> |
| 432 |
<td><div id="simpTAreset"></div></td> |
| 433 |
</tr> |
| 434 |
<tr> |
| 435 |
<td><label for="textareasel">TextArea:</label></td> |
| 436 |
<td><div id="textareasel"></div></td> |
| 437 |
<td><div id="textareatext"></div></td> |
| 438 |
<td><div id="textareaoutput"></div></td> |
| 439 |
<td><div id="textareareset"></div></td> |
| 440 |
</tr> |
| 441 |
</tbody> |
| 442 |
</table> |
| 443 |
|
| 444 |
<h2>Declarative creation of Form elements:</h2> |
| 445 |
<table> |
| 446 |
<tbody> |
| 447 |
<tr> |
| 448 |
<td><label>Widget</label></td> |
| 449 |
<td><label></label></td> |
| 450 |
<td><label>Textbox</label></td> |
| 451 |
<td><label>Output</label></td> |
| 452 |
<td><label>Model Reset</label></td> |
| 453 |
</tr> |
| 454 |
<tr> |
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
<td><label for="decsel">Select:</label></td> |
| 468 |
<td> |
| 469 |
<select id="decsel" style="width: 188px;" |
| 470 |
data-dojo-id="decsel" data-dojo-type="dijit.form.Select" |
| 471 |
data-dojo-props='store:store, name:"decsel",loadChildrenOnOpen: true, value: at(decselctrl, "number")'> |
| 472 |
</select> |
| 473 |
</td> |
| 474 |
<td> |
| 475 |
<input class="cell" id="decseltext" data-dojo-type="dijit.form.TextBox" |
| 476 |
data-dojo-props="value: at(decselctrl, 'number')"></input> |
| 477 |
</td> |
| 478 |
<td><span id="decselOutput" data-dojo-type="dojox.mvc.Output" |
| 479 |
data-dojo-props="value: at(decselctrl, 'number')"> |
| 480 |
${this.value} |
| 481 |
</span></td> |
| 482 |
<td><button id="decselReset" type="button" data-dojo-type="dijit.form.Button" |
| 483 |
data-dojo-props="onClick: function(){decselctrl.reset();}">Reset</button></td> |
| 484 |
</tr> |
| 485 |
<tr> |
| 486 |
<td><label for="decfilsel">FilteringSelect:</label></td> |
| 487 |
<td> |
| 488 |
<input id="decfilsel" data-dojo-type="dijit.form.FilteringSelect" |
| 489 |
data-dojo-props='store:store, value: at(decfilctrl, "number")'/> |
| 490 |
</td> |
| 491 |
<td> |
| 492 |
<input id="decfiltext" data-dojo-type="dijit.form.TextBox" |
| 493 |
data-dojo-props="value: at(decfilctrl, 'number')"></input> |
| 494 |
</td> |
| 495 |
<td><span id="decfilOutput" data-dojo-type="dojox.mvc.Output" |
| 496 |
data-dojo-props="value: at(decfilctrl, 'number')"> |
| 497 |
${this.value} |
| 498 |
</span></td> |
| 499 |
<td><button id="decfilReset" type="button" data-dojo-type="dijit.form.Button" |
| 500 |
data-dojo-props="onClick: function(){decfilctrl.reset();}">Reset</button></td> |
| 501 |
</tr> |
| 502 |
<tr> |
| 503 |
<td><label for="deccombosel">ComboBox:</label></td> |
| 504 |
<td> |
| 505 |
<input id="deccombosel" data-dojo-type="dijit.form.ComboBox" |
| 506 |
data-dojo-props='store:store, value: at(deccomboctrl, "number")'/> |
| 507 |
</td> |
| 508 |
<td> |
| 509 |
<input id="deccombotext" data-dojo-type="dijit.form.TextBox" |
| 510 |
data-dojo-props="value: at(deccomboctrl, 'number')"></input> |
| 511 |
</td> |
| 512 |
<td><span id="deccomboOutput" data-dojo-type="dojox.mvc.Output" |
| 513 |
data-dojo-props="value: at(deccomboctrl, 'number')"> |
| 514 |
${this.value} |
| 515 |
</span></td> |
| 516 |
<td><button id="deccomboReset" type="button" data-dojo-type="dijit.form.Button" |
| 517 |
data-dojo-props="onClick: function(){deccomboctrl.reset();}">Reset</button></td> |
| 518 |
</tr> |
| 519 |
<tr> |
| 520 |
<td><label for="datesel">DateTextBox:</label></td> |
| 521 |
<td> |
| 522 |
<input id="decdatesel" data-dojo-type="dijit.form.DateTextBox" |
| 523 |
data-dojo-props='store:store, value: at(decdatectrl, "number")'/> |
| 524 |
</td> |
| 525 |
<td> |
| 526 |
<input id="decdatetext" data-dojo-type="dijit.form.TextBox" |
| 527 |
data-dojo-props="value: at(decdatectrl, 'number')"></input> |
| 528 |
</td> |
| 529 |
<td><span id="decdateOutput" data-dojo-type="dojox.mvc.Output" |
| 530 |
data-dojo-props="value: at(decdatectrl, 'number')"> |
| 531 |
${this.value} |
| 532 |
</span></td> |
| 533 |
<td><button id="decdateReset" type="button" data-dojo-type="dijit.form.Button" |
| 534 |
data-dojo-props="onClick: function(){decdatectrl.reset();}">Reset</button></td> |
| 535 |
</tr> |
| 536 |
<tr> |
| 537 |
<td><label for="decslidersel">Slider:</label></td> |
| 538 |
<td> |
| 539 |
<input id="decslidersel" data-dojo-type="dijit.form.HorizontalSlider" |
| 540 |
data-dojo-props='store:store, value: at(decsliderctrl, "number"), |
| 541 |
style:{width:"190px"}, minimum:0, maximum:100, discreteValues:21'/> |
| 542 |
</td> |
| 543 |
<td> |
| 544 |
<input id="decslidertext" data-dojo-type="dijit.form.TextBox" |
| 545 |
data-dojo-props="value: at(decsliderctrl, 'number')"></input> |
| 546 |
</td> |
| 547 |
<td><span id="decsliderOutput" data-dojo-type="dojox.mvc.Output" |
| 548 |
data-dojo-props="value: at(decsliderctrl, 'number')"> |
| 549 |
${this.value} |
| 550 |
</span></td> |
| 551 |
<td><button id="decsliderReset" type="button" data-dojo-type="dijit.form.Button" |
| 552 |
data-dojo-props="onClick: function(){decsliderctrl.reset();}">Reset</button></td> |
| 553 |
</tr> |
| 554 |
<tr> |
| 555 |
<td><label for="decnumspinsel">NumberSpinner:</label></td> |
| 556 |
<td> |
| 557 |
<input id="decnumspinsel" data-dojo-type="dijit.form.NumberSpinner" |
| 558 |
data-dojo-props='store:store, value: at(decnumspinctrl, "number")'/> |
| 559 |
</td> |
| 560 |
<td> |
| 561 |
<input id="decnumspintext" data-dojo-type="dijit.form.TextBox" |
| 562 |
data-dojo-props="value: at(decnumspinctrl, 'number')"></input> |
| 563 |
</td> |
| 564 |
<td><span id="decnumspinOutput" data-dojo-type="dojox.mvc.Output" |
| 565 |
data-dojo-props="value: at(decnumspinctrl, 'number')"> |
| 566 |
${this.value} |
| 567 |
</span></td> |
| 568 |
<td><button id="decnumspinReset" type="button" data-dojo-type="dijit.form.Button" |
| 569 |
data-dojo-props="onClick: function(){decnumspinctrl.reset();}">Reset</button></td> |
| 570 |
</tr> |
| 571 |
<tr> |
| 572 |
<td><label for="decsimpTAsel">SimpleTextArea:</label></td> |
| 573 |
<td> |
| 574 |
<input id="decsimpTAsel" data-dojo-type="dijit.form.Textarea" |
| 575 |
data-dojo-props='store:store, value: at(decsimpTActrl, "number")'/> |
| 576 |
</td> |
| 577 |
<td> |
| 578 |
<input id="decsimpTAtext" data-dojo-type="dijit.form.TextBox" |
| 579 |
data-dojo-props="value: at(decsimpTActrl, 'number')"/> |
| 580 |
</td> |
| 581 |
<td><span id="decsimpTAOutput" data-dojo-type="dojox.mvc.Output" |
| 582 |
data-dojo-props="value: at(decsimpTActrl, 'number')"> |
| 583 |
${this.value} |
| 584 |
</span></td> |
| 585 |
<td><button id="decsimpTAReset" type="button" data-dojo-type="dijit.form.Button" |
| 586 |
data-dojo-props="onClick: function(){decsimpTActrl.reset();}">Reset</button></td> |
| 587 |
</tr> |
| 588 |
<tr> |
| 589 |
<td><label for="dectextareasel">TextArea:</label></td> |
| 590 |
<td> |
| 591 |
<input id="dectextareasel" data-dojo-type="dijit.form.Textarea" |
| 592 |
data-dojo-props='store:store, value: at(dectextareactrl, "number")'/> |
| 593 |
</td> |
| 594 |
<td> |
| 595 |
<input id="dectextareatext" data-dojo-type="dijit.form.TextBox" |
| 596 |
data-dojo-props="value: at(dectextareactrl, 'number')"/> |
| 597 |
</td> |
| 598 |
<td><span id="dectextareaOutput" data-dojo-type="dojox.mvc.Output" |
| 599 |
data-dojo-props="value: at(dectextareactrl, 'number')"> |
| 600 |
${this.value} |
| 601 |
</span></td> |
| 602 |
<td><button id="dectextareaReset" type="button" data-dojo-type="dijit.form.Button" |
| 603 |
data-dojo-props="onClick: function(){dectextareactrl.reset();}">Reset</button></td> |
| 604 |
</tr> |
| 605 |
</tbody> |
| 606 |
</table> |
| 607 |
|
| 608 |
<h2>Test data-bound dijit.Calendar:</h2> |
| 609 |
<table> |
| 610 |
<tbody> |
| 611 |
<tr> |
| 612 |
<td><label>Widget</label></td> |
| 613 |
<td><label></label></td> |
| 614 |
<td><label>Textbox</label></td> |
| 615 |
<td><label>Output</label></td> |
| 616 |
<td><label>Model Reset</label></td> |
| 617 |
</tr> |
| 618 |
<tr> |
| 619 |
<td><label for="deccal">Calendar:</label></td> |
| 620 |
<td> |
| 621 |
<input class="cell" id="deccal" data-dojo-id="deccal" data-dojo-type="dijit.Calendar" |
| 622 |
data-dojo-props='value: at(deccalctrl, "date") '/> |
| 623 |
</td> |
| 624 |
<td> |
| 625 |
<input class="cell" id="deccaltext" data-dojo-type="dijit.form.TextBox" |
| 626 |
data-dojo-props="value: at(deccalctrl, 'date')"></input> |
| 627 |
</td> |
| 628 |
<td><span id="deccalOutput" data-dojo-type="dojox.mvc.Output" |
| 629 |
data-dojo-props="value: at(deccalctrl, 'date')"> |
| 630 |
${this.value} |
| 631 |
</span></td> |
| 632 |
<td><button id="deccalReset" type="button" data-dojo-type="dijit.form.Button" |
| 633 |
data-dojo-props="onClick: function(){deccalctrl.reset();}">Reset</button></td> |
| 634 |
</tr> |
| 635 |
<tr> |
| 636 |
<td><label for="deccolor">ColorPalette:</label></td> |
| 637 |
<td> |
| 638 |
<div id="deccolor" data-dojo-type="dijit.ColorPalette" |
| 639 |
data-dojo-props='palette:"3x4", value: at(deccolorctrl, "code")'></div> |
| 640 |
</td> |
| 641 |
<td> |
| 642 |
<input class="cell" id="deccolortext" data-dojo-type="dijit.form.TextBox" |
| 643 |
data-dojo-props="value: at(deccolorctrl, 'code')"></input> |
| 644 |
</td> |
| 645 |
<td><span id="deccolorOutput" data-dojo-type="dojox.mvc.Output" |
| 646 |
data-dojo-props="value: at(deccolorctrl, 'code')"> |
| 647 |
${this.value} |
| 648 |
</span></td> |
| 649 |
<td><button id="deccolorReset" type="button" data-dojo-type="dijit.form.Button" |
| 650 |
data-dojo-props="onClick: function(){deccolorctrl.reset();}">Reset</button></td> |
| 651 |
</tr> |
| 652 |
</tbody> |
| 653 |
</table> |
| 654 |
</div> |
| 655 |
</div> |
| 656 |
</div> |
| 657 |
</body> |
| 658 |
</html> |