Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
commandbutton在使用内联编辑ShowNoneEdit显示时更改其位置,而不是在使用javascript函数显示时更改_Javascript_Css - Fatal编程技术网

commandbutton在使用内联编辑ShowNoneEdit显示时更改其位置,而不是在使用javascript函数显示时更改

commandbutton在使用内联编辑ShowNoneEdit显示时更改其位置,而不是在使用javascript函数显示时更改,javascript,css,Javascript,Css,我在一个div中有两个命令按钮,最初显示为隐藏 <div style="width:1000px;height:50px;text-align:left;"> <apex:commandButton value="Save" oncomplete="triggerBlurEvents();" id="saveButton" style="display:none" /> <apex:commandButton action="{!cancel}" val

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

<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。关于JavaScript函数调用:

<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();"  >

函数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';
}
和2。在线编辑:

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


在场景1中,保存和取消按钮显示在另一个按钮的顶部,在场景2中,它们并排显示。有人能帮我解决这个问题吗

有没有为按钮应用CSS?没有,只有style=“display:none”用于commandbutton,并且为包含按钮的div定义了样式。