Servis-Rhino 4211B Guia do Utilizador Página 198

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 298
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 197
The function should return a new item that will be inserted into the calendar. If a return
without data is executed, no new entry will be added.
The widget also has some very useful functions available upon it:
floorDate()
floorToDay()
The widget also responds to events:
onItemContextMenu – Invoked when a context menu is request. Passed in object
contains:
item – The item that was chosen.
source – The object that is the source of the selection.
triggerEvent – The event that caused the menu to be shown.
See also:
dojox.calendar – Reference info 1.9
Object Stores and Data Stores
Parsing Dijit in HTML
Within an HTML page we can insert markers in the source of the HTML that will be parsed when
Dojo is loaded. These markers will be used to dynamically create instances of Dijit widgets. The
purpose of this technique is to allow us to declaratively build web pages that use the Dijit widgets
without having to explicitly code those up in JavaScript.
Dijit widgets can be created automatically in pages by flagging HTML elements with an indication
of the type of Dijit widget to be created. The type is flagged using the "data-dojo-type"
attribute:
data-dojo-type="<Widget Type>"
The Widget Type is a package name such as "dijit/form/Button".
Properties of the widget can also be supplied with:
data-dojo-props="<properties>"
The format of these properties is "name: value, name: value ..."
A global variable can be created and will be assigned as a reference to the newly created widget
using the following syntax:
data-dojo-id="<variableName>"
We need to be careful if we are defining modules and those modules have an expectation that all
parsing has been completed before having their core functions executed.
In the definition of such modules, code the following:
require(["dojo/ready", …], function(ready, …) {
ready(function() {
// Code here will be run after initializations.
}
});
When using the parser, we typically include markup that looks as follows:
<div data-dojo-type="module/myWidget">
</div>
Page 198
Vista de página 197
1 2 ... 193 194 195 196 197 198 199 200 201 202 203 ... 297 298

Comentários a estes Manuais

Sem comentários