本文整理汇总了PHP中Varien_Data_Form_Element_Select::getAfterElementHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Select::getAfterElementHtml方法的具体用法?PHP Varien_Data_Form_Element_Select::getAfterElementHtml怎么用?PHP Varien_Data_Form_Element_Select::getAfterElementHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Select
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Select::getAfterElementHtml方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$html .= '
<script type="text/javascript">
var switchStatementPoStatusSelect = function() {
for (i=0; i<$("statement_po_type").options.length; i++) {
var statusSel = $("statement_"+$("statement_po_type").options[i].value+"_status")
if (statusSel) {
if (statusSel.id == "statement_"+$("statement_po_type").value+"_status") {
statusSel.up("tr").show()
statusSel.enable()
} else {
statusSel.up("tr").hide()
statusSel.disable()
}
}
}
}
$("statement_po_type").observe("change", switchStatementPoStatusSelect)
document.observe("dom:loaded", switchStatementPoStatusSelect)
</script>
';
return $html;
}
示例2: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$html .= '
<script type="text/javascript">
var switchPayoutPoStatusSelect = function() {
var defStPoType = "' . Mage::getStoreConfig('udropship/statement/statement_po_type') . '";
var getStPoType = function(val) {
return val == "999" ? defStPoType : val;
}
for (i=0; i<$("statement_po_type").options.length; i++) {
var statusSel = $("payout_"+getStPoType($("statement_po_type").options[i].value)+"_status");
if (statusSel) {
if (statusSel.id == "payout_"+getStPoType($("statement_po_type").value)+"_status" && $("payout_po_status_type").value == "payout") {
statusSel.up("tr").show();
statusSel.enable();
} else {
statusSel.up("tr").hide();
statusSel.disable();
}
}
}
}
document.observe("dom:loaded", function(){
$("payout_po_status_type").observe("change", switchPayoutPoStatusSelect)
$("statement_po_type").observe("change", switchPayoutPoStatusSelect)
switchPayoutPoStatusSelect();
});
</script>
';
return $html;
}
示例3: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$defPoType = (string) Mage::getStoreConfig('udropship/statement/statement_po_type');
$html .= '
<script type="text/javascript">
var switchStatementPoStatusSelect = function() {
for (i=0; i<$("statement_po_type").options.length; i++) {
var poTypeValue = $("statement_po_type").value;
if (poTypeValue == "999") {
poTypeValue = "' . $defPoType . '";
}
var statusSel = $("statement_"+$("statement_po_type").options[i].value+"_status")
if (statusSel) {
if (statusSel.id == "statement_"+poTypeValue+"_status") {
statusSel.up("tr").show()
statusSel.enable()
} else {
statusSel.up("tr").hide()
statusSel.disable()
}
}
}
}
$("statement_po_type").observe("change", switchStatementPoStatusSelect)
document.observe("dom:loaded", switchStatementPoStatusSelect)
</script>
';
return $html;
}
示例4: getAfterElementHtml
public function getAfterElementHtml()
{
$vendor = Mage::registry('vendor_data');
$vId = $vendor ? $vendor->getId() : 0;
$html = parent::getAfterElementHtml();
$htmlId = $this->getHtmlId();
if (Mage::helper('udtiership')->isV2SimpleRates()) {
$targetHtmlId = str_replace('delivery_type_selector', 'v2_simple_rates', $htmlId) . '_container';
} elseif (Mage::helper('udtiership')->isV2SimpleConditionalRates()) {
$targetHtmlId = str_replace('delivery_type_selector', 'v2_simple_cond_rates', $htmlId) . '_container';
} else {
$targetHtmlId = str_replace('delivery_type_selector', 'v2_rates', $htmlId) . '_container';
}
$targetUrl = Mage::getModel('core/url')->getUrl('udtiershipadmin/index/loadVendorRates', array('delivery_type' => 'DELIVERYTYPE', 'vendor_id' => $vId));
$html .= "\n <script type=\"text/javascript\">\n Event.observe('{$htmlId}', 'change', function(){\n if (\$F('{$htmlId}')) {\n var targetHtmlId = '{$targetHtmlId}';\n new Ajax.Updater(targetHtmlId, '{$targetUrl}'.replace('DELIVERYTYPE', \$F('{$htmlId}')), {asynchronous:true, evalScripts:true});\n }\n });\n </script>";
return $html;
}
示例5: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$html .= '
<script type="text/javascript">
var switchNotifyLowstockSelect = function() {
if ($("notify_lowstock").value==1) {
$("notify_lowstock_qty").up("tr").show()
$("notify_lowstock_qty").enable()
} else {
$("notify_lowstock_qty").up("tr").hide()
$("notify_lowstock_qty").disable()
}
}
$("notify_lowstock").observe("change", switchNotifyLowstockSelect)
document.observe("dom:loaded", switchNotifyLowstockSelect)
</script>
';
return $html;
}
示例6: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$fc = (array) $this->getData('field_config');
if (isset($fc['depend_fields']) && ($dependFields = (array) $fc['depend_fields'])) {
foreach ($dependFields as &$dv) {
$dv = explode(',', $dv);
}
$dfJson = Zend_Json::encode($dependFields);
$html .= <<<EOT
<script type="text/javascript">
document.observe("dom:loaded", function() {
\tvar df = \$H({$dfJson})
\tvar syncDependFields = function() {
\t\tdf.each(function(pair){
\t\t\tif (\$(pair.key) && (trElem = \$(pair.key+'-container'))) {
\t\t\t\tif (\$A(pair.value).indexOf(\$('{$this->getHtmlId()}').value) != -1) {
\t\t\t\t\ttrElem.show()
\t\ttrElem.select('select').invoke('enable')
\t\ttrElem.select('input').invoke('enable')
\t\ttrElem.select('textarea').invoke('enable')
\t} else {
\t\ttrElem.hide()
\t\ttrElem.select('select').invoke('disable')
\t\ttrElem.select('input').invoke('disable')
\t\ttrElem.select('textarea').invoke('disable')
\t}
\t\t\t}
\t\t})
\t}
\$('{$this->getHtmlId()}').observe('change', syncDependFields)
syncDependFields()
})
</script>
EOT;
}
return $html;
}
示例7: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$htmlId = $this->getHtmlId();
$ratesHtmlId = str_replace('udtiership_use_custom', 'udtiership_rates', $htmlId);
$curProd = Mage::registry('current_product');
if ($curProd && $curProd->getData('_edit_in_vendor')) {
$trTag = 'li';
} else {
$trTag = 'tr';
}
$html .= <<<EOT
<script type="text/javascript">
var syncUdtiershipUseCustom = function() {
if (\$('{$ratesHtmlId}') && (trElem = \$('{$ratesHtmlId}').up("{$trTag}"))) {
if (\$F('{$htmlId}') && \$F('{$htmlId}')!='0') {
trElem.show();
trElem.select('select').invoke('enable');
trElem.select('input').invoke('enable');
trElem.select('textarea').invoke('enable');
} else {
trElem.hide();
trElem.select('select').invoke('disable');
trElem.select('input').invoke('disable');
trElem.select('textarea').invoke('disable');
}
\t}
}
document.observe('dom:loaded', function() {
\$('{$htmlId}').observe('change', syncUdtiershipUseCustom);
syncUdtiershipUseCustom();
});
</script>
EOT;
return $html;
}
示例8: getAfterElementHtml
public function getAfterElementHtml()
{
$javaScript = "\n <script type=\"text/javascript\">\n Event.observe('{$this->getHtmlId()}', 'change', function(){\n specific=\$('{$this->getHtmlId()}').value;\n \$('{$this->_getSpecificCountryElementId()}').disabled = (!specific || specific!=1);\n });\n </script>";
return $javaScript . parent::getAfterElementHtml();
}
示例9: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$fc = (array) $this->getData('field_config');
if (isset($fc['depend_fields']) && ($dependFields = (array) $fc['depend_fields']) || isset($fc['hide_depend_fields']) && ($hideDependFields = (array) $fc['hide_depend_fields'])) {
if (!empty($dependFields)) {
foreach ($dependFields as &$dv) {
$dv = $dv != '' ? explode(',', $dv) : array('');
}
unset($dv);
$dfJson = Zend_Json::encode($dependFields);
} else {
$dfJson = '{}';
}
if (!empty($hideDependFields)) {
foreach ($hideDependFields as &$dv) {
$dv = $dv != '' ? explode(',', $dv) : array('');
}
unset($dv);
$hideDfJson = Zend_Json::encode($hideDependFields);
} else {
$hideDfJson = '{}';
}
$html .= <<<EOT
<script type="text/javascript">
document.observe("dom:loaded", function() {
\tvar df = \$H({$dfJson});
\tvar hideDf = \$H({$hideDfJson});
\tvar enableDisable = function (pair, flag) {
if (\$(pair.key) && (trElem = \$(pair.key).up("tr"))) {
if (flag == (\$A(pair.value).indexOf(\$('{$this->getHtmlId()}').value) != -1)) {
trElem.show()
trElem.select('select').each(function(__sEl){
__sEl.enable();
if (__sEl.udSyncDependFields) {
__sEl.udSyncDependFields();
}
});
trElem.select('input').invoke('enable')
trElem.select('textarea').invoke('enable')
} else {
trElem.hide()
trElem.select('select').invoke('disable')
trElem.select('input').invoke('disable')
trElem.select('textarea').invoke('disable')
}
}
}
\tvar syncDependFields = function() {
\t\tdf.each(function(pair){
\t\t\tenableDisable(pair, true);
\t\t});
\t\thideDf.each(function(pair){
\t\t\tenableDisable(pair, false);
\t\t});
\t}
\t\$('{$this->getHtmlId()}').udSyncDependFields = syncDependFields;
\$('{$this->getHtmlId()}').observe('change', \$('{$this->getHtmlId()}').udSyncDependFields.bind(\$('{$this->getHtmlId()}')))
\$('{$this->getHtmlId()}').udSyncDependFields()
})
</script>
EOT;
}
return $html;
}