annotate shared_view/includes/dojo/form/CheckboxSelect.tt @ 11:573272ec604b

almost comlete doxygen library
author sergey
date Thu, 15 May 2014 18:24:02 +0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
1 [%
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
2 BLOCK INIT;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
3 document.dojo.modules.push("dijit/form/CheckBox");
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
4 END;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
5 IF metadata.inputType == 'password';
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
6 value = '';
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
7 ELSE;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
8 value = metadata.inputValue;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
9 END;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
10
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
11 selected = {};
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
12
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
13 FOREACH item IN metadata.inputValue;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
14 selected.${item} = 1;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
15 END;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
16
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
17 options = [];
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
18 valueField = "roleName";
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
19 labelField = "roleName";
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
20
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
21 FOREACH item IN resource.GetDataSource(metadata.GetSchemaProperty('data-source-name')).data;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
22 options.push({
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
23 label = item.$labelField,
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
24 value = item.$valueField,
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
25 selected = selected.${item.$labelField}
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
26 });
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
27 END;
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
28 %]
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
29 [% FOREACH option IN options %]
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
30 <div>
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
31 <input type="checkbox" name="$prefix" value="$option.value"[% IF option.selected %] checked="true"[% END %]/><span>$option.label</span>
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
32 </div>
573272ec604b almost comlete doxygen library
sergey
parents:
diff changeset
33 [% END %]