1: <?php
2: /**
3: * QListBox.class.php contains the QListBox
4: * @package Controls
5: */
6: /**
7: * The QListBox class is based upon QListBoxBase.
8: *
9: * The purpose of this class is entirely to provide a place for you to make modifications of the QListBox control.
10: * All updates in QCubed releases will make changes to the QListBoxBase class. By making your modifications here
11: * instead of in the base class, you can ensure that your changes are not affected by core improvements.
12: *
13: * @package Controls
14: */
15: class QListBox extends QListBoxBase {
16: ///////////////////////////
17: // ListBox Preferences
18: ///////////////////////////
19:
20: // Feel free to specify global display preferences/defaults for all QListBox controls
21: /** @var string Default CSS class for the listbox */
22: protected $strCssClass = 'listbox';
23: // protected $strFontNames = QFontFamily::Verdana;
24: // protected $strFontSize = '12px';
25: // protected $strWidth = '250px';
26:
27: /**
28: * Creates the reset button html for use with multiple select boxes.
29: *
30: */
31: protected function GetResetButtonHtml() {
32: $strJavaScriptOnClick = sprintf('$j("#%s").val(null);$j("#%s").trigger("change"); return false;', $this->strControlId,$this->strControlId);
33:
34: $strToReturn = sprintf(' <a id="reset_ctl_%s" href="#" class="listboxReset">%s</a>',
35: $this->strControlId,
36: QApplication::Translate('Reset')
37: );
38:
39: QApplication::ExecuteJavaScript(sprintf('$j("#reset_ctl_%s").on("%s", function(){ %s });', $this->strControlId, "click", $strJavaScriptOnClick));
40:
41: return $strToReturn;
42: }
43: }