|
|
|
@ -66,6 +66,14 @@ class SelectAjax extends HTML_QuickForm_select |
|
|
|
$this->setAttribute('id', $id); |
|
|
|
$this->setAttribute('id', $id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$url = $this->getAttribute('url'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$url) { |
|
|
|
|
|
|
|
$url = $this->getAttribute('url_function'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$url = "'$url'"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$html .= <<<JS |
|
|
|
$html .= <<<JS |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
$(function(){ |
|
|
|
$(function(){ |
|
|
|
@ -76,7 +84,7 @@ class SelectAjax extends HTML_QuickForm_select |
|
|
|
width: '$width', |
|
|
|
width: '$width', |
|
|
|
minimumInputLength: '$minimumInputLength', |
|
|
|
minimumInputLength: '$minimumInputLength', |
|
|
|
ajax: { |
|
|
|
ajax: { |
|
|
|
url: '{$this->getAttribute('url')}', |
|
|
|
url: $url, |
|
|
|
dataType: 'json', |
|
|
|
dataType: 'json', |
|
|
|
data: function(params) { |
|
|
|
data: function(params) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
@ -102,6 +110,7 @@ JS; |
|
|
|
$this->removeAttribute('placeholder'); |
|
|
|
$this->removeAttribute('placeholder'); |
|
|
|
$this->removeAttribute('class'); |
|
|
|
$this->removeAttribute('class'); |
|
|
|
$this->removeAttribute('url'); |
|
|
|
$this->removeAttribute('url'); |
|
|
|
|
|
|
|
$this->removeAttribute('url_function'); |
|
|
|
$this->setAttribute('style', 'width: 100%;'); |
|
|
|
$this->setAttribute('style', 'width: 100%;'); |
|
|
|
|
|
|
|
|
|
|
|
return parent::toHtml() . $html; |
|
|
|
return parent::toHtml() . $html; |
|
|
|
|