]>
git.wh0rd.org - tt-rss.git/blob - lib/_CheckBoxTreeNode.js
1 define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree"], function (declare
, domConstruct
) {
3 return declare("lib._CheckBoxTreeNode", dijit
._TreeNode
,
5 // _checkbox: [protected] dojo.doc.element
6 // Local reference to the dojo.doc.element of type 'checkbox'
9 _createCheckbox: function () {
11 // Create a checkbox on the CheckBoxTreeNode
13 // Create a checkbox on the CheckBoxTreeNode. The checkbox is ONLY created if a
14 // valid reference was found in the dojo.data store or the attribute 'checkboxAll'
15 // is set to true. If the current state is 'undefined' no reference was found and
16 // 'checkboxAll' is set to false.
17 // Note: the attribute 'checkboxAll' is validated by the getCheckboxState function
18 // therefore no need to do that here. (see getCheckboxState for details).
20 var currState
= this.tree
.model
.getCheckboxState(this.item
);
21 if (currState
!== undefined) {
22 this._checkbox
= new dijit
.form
.CheckBox();
23 //this._checkbox = dojo.doc.createElement('input');
24 this._checkbox
.type
= 'checkbox';
25 this._checkbox
.attr('checked', currState
);
26 domConstruct
.place(this._checkbox
.domNode
, this.expandoNode
, 'after');
30 postCreate: function () {
32 // Handle the creation of the checkbox after the CheckBoxTreeNode has been instanciated.
34 // Handle the creation of the checkbox after the CheckBoxTreeNode has been instanciated.
35 this._createCheckbox();
36 this.inherited(arguments
);