当使用javascript函数显示时,使用内联编辑显示编辑显示命令按钮时更改其位置

时间:2015-01-04 14:48:18

标签: javascript css

我在div中有2个命令按钮,最初显示为隐藏。

<div style="width:1000px;height:50px;text-align:left;">
  <apex:commandButton value="Save" oncomplete="triggerBlurEvents();"   id="saveButton" style="display:none" />
  <apex:commandButton action="{!cancel}" value="Cancel" id="cancelButton" reRender="thePageBlock" style="display: none;" />
</div>

可以显示这些按钮 的 1。关于javacript函数调用:

<script>               
  function show() {

    document.getElementById("{!$Component.thePage.theForm.thePageBlock.saveButton}").style.display='block';

    document.getElementById("{!$Component.thePage.theForm.thePageBlock.cancelButton}").style.display='block';

    document.getElementById("{!$Component.thePage.theForm.thePageBlock.AddMoreButton}").style.display='none';

  }
</script>

<apex:selectList value="{!k.Abv_Core_KAM_Competitor_Product__c}" multiselect="false" size="1" onchange="show();"  >

和2.内联编辑:

<apex:inlineEditSupport event="ondblClick"   showOnEdit="saveButton,cancelButton" hideOnEdit="AddMoreButton" /> 

在方案1中,保存和取消按钮显示在另一个之上,在方案2中,它们并排显示。任何人都可以帮我解决这个问题吗?

0 个答案:

没有答案