25 $js->
execOn(
"change",
"#".$this->identifier.
" [name='selection[]']:not(._jsonArrayChecked)", $this->_getCheckedChange($js));
26 if(JArray::count($this->_compileParts)<3){
27 $js->
trigger(
"#".$this->identifier.
" [name='selection[]']",
"change",
true);
32 $callback=
"var \$parentCheckbox=\$('#ck-main-ck-{$this->identifier}'),\$checkbox=\$('#{$this->identifier} [name=\"selection[]\"]'),allChecked=true,allUnchecked=true;
33 \$checkbox.each(function() {if($(this).prop('checked')){allUnchecked = false;}else{allChecked = false;}});
34 if(allChecked) {\$parentCheckbox.checkbox('set checked');}else if(allUnchecked){\$parentCheckbox.checkbox('set unchecked');}else{\$parentCheckbox.checkbox('set indeterminate');};".$this->_getCheckedMessageCall($js);
40 $checkedMessageFunction=
"$('#{$this->identifier}').bind('updateChecked',function() {var msg='".$msg[0].
"',count=\$('#{$this->identifier} [name=\"selection[]\"]:checked').length,all=\$('#{$this->identifier} [name=\"selection[]\"]').length;
41 if(count==1) msg='".$msg[1].
"';
42 else if(count>1) msg='".$msg[
"other"].
"';
43 \$('#checked-count-".$this->identifier.
"').contents().filter(function() {return this.nodeType == 3;}).each(function(){this.textContent = msg.replace('{count}',count);});
44 \$('#toolbar-{$this->identifier} .visibleOnChecked').toggle(count>0);});\$('#toolbar-".$this->identifier.
" .visibleOnChecked').hide();";
45 return $checkedMessageFunction;
49 $checkedMessageCall=
"";
50 if($this->_hasCheckedMessage){
51 $checkedMessageCall=
"$('#{$this->identifier}').trigger('updateChecked');";
52 if(isset($this->_checkedClass)){
53 $checkedMessageCall.=
"$(this).closest('tr').toggleClass('".$this->_checkedClass.
"',$(this).prop('checked'));";
58 return $checkedMessageCall;
63 $checkedMessageCall=
"";
64 if($this->_hasCheckedMessage)
65 $checkedMessageCall=
"$('#{$this->identifier}').trigger('updateChecked');";
67 $ck->setOnChecked($this->
_setAllChecked(
"true").$checkedMessageCall);
68 $ck->setOnUnchecked($this->
_setAllChecked(
"false").$checkedMessageCall);
69 \array_unshift($captions, $ck);
73 $result=
"$('#".$this->identifier.
" [name=%quote%selection[]%quote%]:not(._jsonArrayChecked)').prop('checked',".$checked.
");";
74 if(isset($this->_checkedClass)){
75 $result.=
"$('#".$this->identifier.
" tr').toggleClass('".$this->_checkedClass.
"',".$checked.
");";
92 $result=[0=>
"none selected",1=>
"one item selected",
"other"=>
"{count} items selected"];
113 if(isset($checkedMessage))
114 $this->_checkedMessage=$checkedMessage;
116 $this->_hasCheckboxes=
true;
117 $this->_hasCheckedMessage=
true;
118 $element=
new HtmlLabel(
"checked-count-".$this->identifier,$checkedMessage[0]);
131 $this->_checkedCallback = $checkedCallback;
trigger($element='this', $event='click', $immediatly=false)
Execute all handlers and behaviors attached to the matched elements for the given event.
execOn($event, $element, $js, $parameters=array())
Executes the javascript code $js when $event fires on $element.
Semantic Label component.