无法在ui5中编辑oData表行

2020-08-15 11:39发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好团队,

选择了表格行后,我无法对其进行编辑,它显示了一个错误(附在screenhot中)。

我附上了逻辑和输出以供您参考。

````''````````````````````Controller.js```````````  `````````````

 返回BaseController.extend(" opensap.manageproducts.ManageProducts.controller.Worklist",{

     格式化程序:formatter,
   /* ================================================  ========== */
   /*生命周期方法*/
   /* ================================================  ========== */

   /**
      *在实例化工作清单控制器时调用。
      * @上市
      */
     onInit:函数(){
         var oViewModel,
             iOriginalBusyDelay,
             oTable = this.byId(" table");

        //编辑表格行
        //var that = this;
         this.oTable = this.byId(" table");
         this.oReadOnlyTemplate = this.byId(" table")。removeItem(0);

         var Url ="/img/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/";
         this.oModel = new sap.ui.model.odata.ODataModel(Url,true);
         this.oTable = this.byId(" table");
         this.getView()。setModel(this.oModel);
         this.oReadOnlyTemplate = this.byId(" table")。removeItem(0);
         this.rebindTable(this.oReadOnlyTemplate,"导航");
         this.oEditableTemplate = new sap.m.ColumnListItem({
             细胞: [
                 新的sap.m.Input({
                     值:" {ProductID}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {SupplierName}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {ToSupplier/WebAddress}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {Price}",
                     可编辑:false
                 })
             ]
         });

 rebindTable:函数(oTemplate,sKeyboardMode){
         this.oTable.bindItems({
             路径:"/img/ProductSet",
             模板:oTemplate,
             templateShareable:true,
             密钥:" ProductId"
         })。setKeyboardMode(sKeyboardMode);
     },

 onOpenMultiEdit:function(){
         this.aProductCollection = deepExtend([],this.oModel.getProperty("/img/ProductSet"));
         this.rebindTable(this.oEditableTemplate," Edit");
         this.oSemanticPage.setShowFooter(!this.oSemanticPage.getShowFooter());
     },

 ``````````````````````  ```````````````````

 
     
         
             
         </semantic:titleHeading>
         <semantic:content>

     <Table id =" table" width =" auto" mode =" MultiSelect"
                         items =" {路径:'/ProductSet',排序器:{路径:'ProductID',降序:false},参数:{扩展:'ToSupplier'}}"
                         noDataText =" {worklistView>/tableNoDataText}"" busyIndi​​catorDelay =" {worklistView>/tableBusyDelay}" growth =" true" growthScrollToLoad =" true"
                         updateFinished ="。onUpdateFinished">
                         <headerToolbar>
                             <OverflowToolbar>
                                 <Title id =" tableHeader" text =" {worklistView>/worklistTableTitle}" level =" H3"/>
                                 <ToolbarSpacer/>
                                 <SearchField id =" searchField"工具提示=" {i18n> worklistSearchTooltip}" search ="。onSearch">
                                     <layoutData>
                                         <OverflowToolbarLayoutData maxWidth =" 200px" priority =" NeverOverflow"/>
                                     </layoutData>
                                 </SearchField>
                                 <Button icon =" sap-icon://add" type =" Transparent" press =" onAdd"/>
                                 <Button type =" Transparent" id =" btnMultiEdit" text ="编辑多个" enabled =" false" press =" onOpenMultiEdit"/>
                             </OverflowToolbar>
                         </headerToolbar>
                         <列>
                             <Column id =" nameColumn">
                                 <Text text =" Products" id =" nameColumnTitle"/>
                             </Column>
                             <Column id =" supplierNameColumn" demandPopin =" true" minScreenWidth =" Tablet">
                                 <!-此属性表示不要在手机上显示此Cloumn,在平板电脑,台式机上显示,但不要在手机上显示
                                                   demandPopin =" true"-使用此属性,我们告诉表格是否未显示该列,然后在弹出窗口中显示->
                                 <Text text ="供应商名称"/>
                             </Column>
                             <Column id =" webAddressColumn" demandPopin =" false" minScreenWidth =" Tablet">
                                 <Text text ="供应商网址"/>
                             </Column>
                             <Column id =" unitNumberColumn" hAlign =" End">
                                 <Text text =" {i18n> tableUnitNumberColumnTitle}" id =" unitNumberColumnTitle"/>
                             </Column>
                             <Column id =" editcolumn" hAlign =" End">
                                 <Text text =" Edit" id =" edit"/>
                             </Column>
                             <Column id =" deleteColumn" hAlign =" End">
                                 <Text text =" Delete" id =" Action"/>
                             </Column>
                         </columns>
                         <项目>
                             <ColumnListItem type =" Navigation" press ="。onPress">
                                 <单元格>
                                     <ObjectIdentifier title =" {ProductID}" text =" {Name}" titleActive =" true" titlePress =" onPressProductId"/>
                                     <Text text =" {SupplierName}"/>
                                     <Link text =" {ToSupplier/WebAddress}" hraf=" {ToSupplier/WebAddress}" target =" _ blank"/>
                                     <ObjectNumber number =" {路径:'Price',格式:'.formatter.numberUnit'}" unit =" {CurrencyCode}"/>/>
                                     <Button icon =" sap-icon://edit" press =" onpressedit" enabled =" false" id =" test"> </Button>
                                     <Button icon =" sap-icon://delete" press =" onpressdelete"> </Button>
                                 </cells>
                             </ColumnListItem>
                         </items>
                     </Table>
                 </content>
             </IconTabBar>
         </semantic:content> <a href="/img/storage/temp/1823934-error.png"> error.png </a> </pre>

    
        
         <p> <img src="/storage/temp/1823934-error.png"> </p>
         (97.5 kB)</p>
  </div>

  <div class="show-content hide hidequestioncontent">
<h6>         <strong><span style="font-size:24px;font-family:'Arial',sans-serif;color:#3C3C3C">点击此处--->
  </span></strong><a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=0G3L9uZTbor8h6vhI8-lICNXNjgwRScW&jump_from=webapi"><img src="https://www.easysap.com/data/ueditor/php/upload/image/20220811/1660198606336474.png" alt="EasySAP.com" title="EasySAP.com"/></a><strong><span style="font-size:24px;font-family:'Arial',sans-serif;color:#3C3C3C">群内免费提供SAP练习系统(在群公告中)</span></strong></h6><p style="margin-top:5px;margin-right:0;margin-bottom:5px;margin-left:
0;text-indent:32px">加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)</p><p style="margin-top:5px;margin-right:0;margin-bottom:5px;margin-left:
0;text-indent:32px"><br/></p><p> <p> <img src="/img/storage/temp/1823936-error.png"> </p> </p>
 <p>你好团队,</p>
 <p>选择了表格行后,我无法对其进行编辑,它显示了一个错误(附在screenhot中)。</p>
 <p>我附上了逻辑和输出以供您参考。</p>
 <pre>````''````````````````````Controller.js```````````  `````````````

 返回BaseController.extend(" opensap.manageproducts.ManageProducts.controller.Worklist",{

     格式化程序:formatter,
   /* ================================================  ========== */
   /*生命周期方法*/
   /* ================================================  ========== */

   /**
      *在实例化工作清单控制器时调用。
      * @上市
      */
     onInit:函数(){
         var oViewModel,
             iOriginalBusyDelay,
             oTable = this.byId(" table");

        //编辑表格行
        //var that = this;
         this.oTable = this.byId(" table");
         this.oReadOnlyTemplate = this.byId(" table")。removeItem(0);

         var Url ="/img/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/";
         this.oModel = new sap.ui.model.odata.ODataModel(Url,true);
         this.oTable = this.byId(" table");
         this.getView()。setModel(this.oModel);
         this.oReadOnlyTemplate = this.byId(" table")。removeItem(0);
         this.rebindTable(this.oReadOnlyTemplate,"导航");
         this.oEditableTemplate = new sap.m.ColumnListItem({
             细胞: [
                 新的sap.m.Input({
                     值:" {ProductID}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {SupplierName}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {ToSupplier/WebAddress}",
                     可编辑:false
                 }),新的sap.m.Input({
                     值:" {Price}",
                     可编辑:false
                 })
             ]
         });

 rebindTable:函数(oTemplate,sKeyboardMode){
         this.oTable.bindItems({
             路径:"/img/ProductSet",
             模板:oTemplate,
             templateShareable:true,
             密钥:" ProductId"
         })。setKeyboardMode(sKeyboardMode);
     },

 onOpenMultiEdit:function(){
         this.aProductCollection = deepExtend([],this.oModel.getProperty("/img/ProductSet"));
         this.rebindTable(this.oEditableTemplate," Edit");
         this.oSemanticPage.setShowFooter(!this.oSemanticPage.getShowFooter());
     },

 ``````````````````````  ```````````````````

 <mvc:查看controllerName =" opensap.manageproducts.ManageProducts.controller.Worklist" xmlns =" sap.m" xmlns:mvc =" sap.ui.core.mvc"
     xmlns:semantic =" sap.f.semantic" xmlns:l =" sap.ui.layout">
     <semantic:SemanticPage id =" page" headerPinnable =" false" toggleHeaderOnTitleClick =" false">
         <semantic:titleHeading>
             <Title text =" {i18n> worklistTitle}" level =" H2"/>
         </semantic:titleHeading>
         <semantic:content>

     <Table id =" table" width =" auto" mode =" MultiSelect"
                         items =" {路径:'/ProductSet',排序器:{路径:'ProductID',降序:false},参数:{扩展:'ToSupplier'}}"
                         noDataText =" {worklistView>/tableNoDataText}"" busyIndi​​catorDelay =" {worklistView>/tableBusyDelay}" growth =" true" growthScrollToLoad =" true"
                         updateFinished ="。onUpdateFinished">
                         <headerToolbar>
                             <OverflowToolbar>
                                 <Title id =" tableHeader" text =" {worklistView>/worklistTableTitle}" level =" H3"/>
                                 <ToolbarSpacer/>
                                 <SearchField id =" searchField"工具提示=" {i18n> worklistSearchTooltip}" search ="。onSearch">
                                     <layoutData>
                                         <OverflowToolbarLayoutData maxWidth =" 200px" priority =" NeverOverflow"/>
                                     </layoutData>
                                 </SearchField>
                                 <Button icon =" sap-icon://add" type =" Transparent" press =" onAdd"/>
                                 <Button type =" Transparent" id =" btnMultiEdit" text ="编辑多个" enabled =" false" press =" onOpenMultiEdit"/>
                             </OverflowToolbar>
                         </headerToolbar>
                         <列>
                             <Column id =" nameColumn">
                                 <Text text =" Products" id =" nameColumnTitle"/>
                             </Column>
                             <Column id =" supplierNameColumn" demandPopin =" true" minScreenWidth =" Tablet">
                                 <!-此属性表示不要在手机上显示此Cloumn,在平板电脑,台式机上显示,但不要在手机上显示
                                                   demandPopin =" true"-使用此属性,我们告诉表格是否未显示该列,然后在弹出窗口中显示->
                                 <Text text ="供应商名称"/>
                             </Column>
                             <Column id =" webAddressColumn" demandPopin =" false" minScreenWidth =" Tablet">
                                 <Text text ="供应商网址"/>
                             </Column>
                             <Column id =" unitNumberColumn" hAlign =" End">
                                 <Text text =" {i18n> tableUnitNumberColumnTitle}" id =" unitNumberColumnTitle"/>
                             </Column>
                             <Column id =" editcolumn" hAlign =" End">
                                 <Text text =" Edit" id =" edit"/>
                             </Column>
                             <Column id =" deleteColumn" hAlign =" End">
                                 <Text text =" Delete" id =" Action"/>
                             </Column>
                         </columns>
                         <项目>
                             <ColumnListItem type =" Navigation" press ="。onPress">
                                 <单元格>
                                     <ObjectIdentifier title =" {ProductID}" text =" {Name}" titleActive =" true" titlePress =" onPressProductId"/>
                                     <Text text =" {SupplierName}"/>
                                     <Link text =" {ToSupplier/WebAddress}" hraf=" {ToSupplier/WebAddress}" target =" _ blank"/>
                                     <ObjectNumber number =" {路径:'Price',格式:'.formatter.numberUnit'}" unit =" {CurrencyCode}"/>/>
                                     <Button icon =" sap-icon://edit" press =" onpressedit" enabled =" false" id =" test"> </Button>
                                     <Button icon =" sap-icon://delete" press =" onpressdelete"> </Button>
                                 </cells>
                             </ColumnListItem>
                         </items>
                     </Table>
                 </content>
             </IconTabBar>
         </semantic:content> <a href="/img/storage/temp/1823934-error.png"> error.png </a> </pre>

    
        
         <p> <img src="/storage/temp/1823934-error.png"> </p>
         (97.5 kB)  </div></div>
<div class="details-con-other border-top">
<div class="">



<div class="three-link">
   <!-- cdn节点 问题操作按钮 -->
                        <div class="cdn_question_button"></div>
</div>
</div>
</div>

</div>
</div>
</div>
<div class="container index" id="showanswerform">
<div class="row">
<div class="col-md-17 main " style="padding: 0px;">
<div class="note ">
<div class="post">
<div class="comment-list">
<div class="new-comment canwirteanswer"
style="margin: 0px 10px 10px 10px;">
<div style="" class="answer-txtbox bb top-answer"
id="answer-txtbox"><form class="new-comment" id="huidaform" name="answerForm"
method="post" style="margin: 10px;">
<input type="hidden" value="5559" id="ans_qid"
name="qid"> <input type="hidden" id="tokenkey" name="tokenkey"
value='' /> <input type="hidden"
value="无法在ui5中编辑oData表行" id="ans_title" name="title">
<script src="https://www.easysap.com/static/js/neweditor/ueditor.config.js" type="text/javascript"></script>
<script src="https://www.easysap.com/static/js/neweditor/ueditor.all.js" type="text/javascript"></script>
<script type="text/plain" id="editor"  name="content"  style="width:100%;height:200px;"></script>                                 
<script type="text/javascript">
                                 var isueditor=1;
            var editor = UE.getEditor('editor',{
                //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
                toolbars:[['fullscreen',   'source','|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|', 'indent', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'link', 'unlink', 'anchor', '|', 'simpleupload', 'insertimage', 'scrawl', 'insertvideo', 'attachment', 'map', 'insertcode', '|', 'horizontal', '|', 'preview', 'searchreplace', 'drafts']],
            
                initialContent:'',
            
            
                //关闭字数统计
                wordCount:false,
                //关闭elementPath
                elementPathEnabled:false,
                //默认的编辑区域高度
                initialFrameHeight:250
                //更多其他参数,请参考ueditor.config.js中的配置项
                //更多其他参数,请参考ueditor.config.js中的配置项
            });

        </script><div class="write-function-block"><div class="hint">付费偷看设置</div>

<div class="emoji-modal-wrap">
<a class="emoji " data-toggle="tooltip"
data-placement="right" title=""
data-original-title="设置付费查看回答金额"> <i
class="fa fa-paypal text-red mar-ly-1"></i>
</a>
</div> <a class="btn btn-send" id="ajaxsubmitasnwer">发送</a>
</div></form></div>


</div>



<div id="comment-list" class="comment-list bb"
style="margin: 0px; margin-bottom: 20px;">

<div id="normal-comment-list" class="normal-comment-list">
<div>
<div>
<div class="top" id="comments">
<span>1条回答</span>

<div class="pull-right"></div>
</div>
</div>                                                                    
           
            <div id="comment-15189" class="comment">
            <div>
                                  <div class="author">
            <a href="https://www.easysap.com/u-144.html" target="_self" class="avatar">
            <img src="https://www.easysap.com//static/css/default/avatar.gif"  onmouseover="showInfoCard(this,'usercard',144)" onmouseout="hideInfoCard('usercard')" >
            </a>
            <div class="info">
            <a href="https://www.easysap.com/u-144.html" target="_self" class="name">
            CJones                                          </a>
            <!---->
             <div class="meta">
             <span>1楼-- · 2020-08-15 11:59</span>
             </div>
             </div>
             </div>
                          <div class="comment-wrap art-content">
             <div class="answercontent" style="max-height:10000000px">
                                                                          <p>您好Subrata,</p>
 <p>问题是您已经使用this.oReadOnlyTemplate绑定了表格中的项目,并且不应与其他模板重新绑定。</p>
 <p>相反,您只能在oReadOnlyTemplate中添加编辑模板的控件,然后根据编辑/显示模式切换控件的可见性。</p>
 <p>这样,您也不需要重新绑定表。</p>
 <p>谢谢</p>
 <p>芦笋</p>                                                                    <div class="appendcontent">
                                                        </div>
            </div>
       
             <div class="tool-group">
             <!-- cdn节点 回答操作 -->
<div class="cdn_question_answer15189"></div>
<script type="text/javascript">
  getquestioncaozuo(5,5559,15189);
</script>

                </div>
                </div>
                  
                </div>


<div class="comments-mod "
style="display: none; float: none; padding-top: 10px;"
id="comment_15189">
<div class="areabox clearfix">

<div class="input-group">
<input type="text" placeholder="请输入评论内容,不少于5个字"
AUTOCOMPLETE="off" class="comment-input form-control"
name="content" /> <input type='hidden' value='0'
name='replyauthor' /> <span class="input-group-btn"><input
type="button" value="评论" class="btn btn-green"
name="submit" onclick="addcomment(15189);" /> </span>
</div>

</div>
<ul class="my-comments-list nav">
<li class="loading text-left"><img
src='https://www.easysap.com/static/css/default/loading.gif'
align='absmiddle' /> 加载中...</li>
</ul>
</div>

</div>
<div class="pages"></div>

</div>
</div>
<div></div>
</div>
<!-- cdn 问答邀请 -->
<div class="cdn_question_invate"></div>		
<script type="text/javascript">
getquestioncaozuo(7,5559);
</script><div class="new-answer bb">
<h3 class="title">
一周热门 <a href="https://www.easysap.com/content/solve.html" target="_blank" class="more">更多<font>>
</font></a>
</h3>
<div class="inf-list">
<ul class="clearfix">
</ul>
</div>
</div>

</div>
</div>


</div>

</div>

<div class="col-md-7  aside "><div class="ad_vip" style="margin-bottom: 10px;">
<a href="javascript:login()"><img style="width: 100%;"
src="https://www.easysap.com/static/images/ad_vip.png" /></a>
    <h6>点击此处--->
                <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=0G3L9uZTbor8h6vhI8-lICNXNjgwRScW&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="EasySAP.com" title="EasySAP.com"></a>
                一起学习S4 HANA ...</h6>
</div><div class="standing">
<div class="positions bb" id="rankScroll">
<h3 class="title">相关问答</h3>
<ul><li class="no-video"><a
href="https://www.easysap.com/q-111093.html"
title="仅针对一种布局的样式"> 仅针对一种布局的样式 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111093.html" class="anum">
4 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111076.html"
title="网关属性标签"> 网关属性标签 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111076.html" class="anum">
1 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111058.html"
title="在SAP HANA内部部署环境中更新SAPUI5交付单元?"> 在SAP HANA内部部署环境中更新SAPUI5交付单元? </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111058.html" class="anum">
7 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111045.html"
title="值帮助对话框控件中的搜索帮助"> 值帮助对话框控件中的搜索帮助 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111045.html" class="anum">
3 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111030.html"
title="SAP UI5:-需要更改Richtext Editor默认文本"> SAP UI5:-需要更改Richtext Editor默认文本 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111030.html" class="anum">
1 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111024.html"
title="在调试模式下加载忙指标,但在运行时不加载"> 在调试模式下加载忙指标,但在运行时不加载 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111024.html" class="anum">
2 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-111020.html"
title="将第三方库添加到SAP Design Studio"> 将第三方库添加到SAP Design Studio </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-111020.html" class="anum">
4 个回答</a>
</div></li> <li class="no-video"><a
href="https://www.easysap.com/q-110903.html"
title="获取SAPUI5 1.38运行时库"> 获取SAPUI5 1.38运行时库 </a>
<div class="num-ask">
<a href="https://www.easysap.com/q-110903.html" class="anum">
2 个回答</a>
</div></li> </ul>
</div>
</div><!--广告位5--></div>
</div>
</div>

<div class="modal fade" id="dialogadopt">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
</button>
<h4 class="modal-title">采纳回答</h4>
</div>
<div class="modal-body">

<form class="form-horizontal" name="editanswerForm" method="post">
<input type="hidden" value="5559" id="adopt_qid"
name="qid" /> <input type="hidden" id="adopt_answer" value="0"
name="aid" />
<table class="table ">
<tr valign="top">
<td>向帮助了您的网友说句感谢的话吧!</td>
</tr>
<tr>
<td>
<div class="inputbox mt15">
<textarea class="form-control" id="adopt_txtcontent"
name="content">非常感谢!</textarea>
</div>
</td>
</tr>
<tr>
<td><button type="button" id="adoptbtn" class="btn btn-success">确 认</button></td>
</tr>
</table>
</form>

</div>

</div>
</div>
</div>
<script>

function checkpay(_qid,_aid){

var url="https://www.easysap.com/answerpay/poppay/"+_qid+"/"+_aid+".html";
var myModalTrigger = new $.zui.ModalTrigger({url:url});
myModalTrigger.show({
'backdrop':'static'
});


}
if(typeof($(".work-show-box").find("img").attr("data-original"))!="undefined"){
var imgurl=$(".work-show-box").find("img").attr("data-original");
$(".work-show-box").find("img").attr("src",imgurl);
}
$(".work-show-box,.answercontent").find("img").attr("data-toggle","lightbox").attr("data-lightbox-group",Date.parse( new Date() ).toString());
var postadopt=false;
$("#adoptbtn").click(function(){
  var data={
    			content:$("#adopt_txtcontent").val(),
    			qid:$("#adopt_qid").val(),
    			aid:$("#adopt_answer").val()

    	}
  	if(postadopt){
  	  	return false;
  	}
  postadopt=true;
$.ajax({
    //提交数据的类型 POST GET
    type:"POST",
    //提交的网址
    url:"https://www.easysap.com/question/ajaxadopt.html",
    //提交的数据
    data:data,
    //返回数据的格式
    datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
    //在请求之前调用的函数
    beforeSend:function(){},
    //成功返回之后调用的函数
    success:function(data){
    	var data=eval("("+data+")");
       if(data.message=='ok'){
    	   new $.zui.Messager('采纳成功!', {
    		   type: 'success',
    		   close: true,
       	    placement: 'center' // 定义显示位置
       	}).show();
    	   setTimeout(function(){
               window.location.reload();
           },1500);
       }else{
    	   new $.zui.Messager(data.message, {
        	   close: true,
        	    placement: 'center' // 定义显示位置
        	}).show();
       }


    }   ,
    //调用执行后调用的函数
    complete: function(XMLHttpRequest, textStatus){
     	postadopt=true;
    },
    //调用出错执行的函数
    error: function(){
        //请求出错处理
    	postadopt=false;
    }
 });
})

</script>
</div>
<!-- 编辑标签 -->

<div class="modal fade" id="dialog_tag">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
</button>
<h4 class="modal-title">编辑标签</h4>
</div>
<div class="modal-body">

<form onsubmit=" return checktagsubmit()" class="form-horizontal"
name="edittagForm" action="https://www.easysap.com/question/edittag.html" method="post">
<input type="hidden" value="5559" name="qid" />

<p>最多设置5个标签!</p>

<div class="inputbox mar-t-1">
<div class=" dongtai ">
<div class="tags"><div class="tag">
<span tagid="2">SAPUI5</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="77">OData    </span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="313">JavaScript</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="456">field masking for SAPUI5 and SAP Fiori    </span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="392">        SAPUI5</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="263">sapui5 developer center</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="2">SAPUI5</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="313">JavaScript</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="453">odata binding</span><i
class="fa fa-close"></i>
</div>
<div class="tag">
<span tagid="313">JavaScript</span><i
class="fa fa-close"></i>
</div>
</div>
<input type="text" autocomplete="off" data-toggle="tooltip"
data-placement="bottom" title=""
placeholder="检索标签,最多添加5个,添加标签更容易被回答"
data-original-title="检索标签,最多添加5个" name="topic_tagset" value=""
class="txt_taginput"> <i class="fa fa-search"></i>
<div class="tagsearch"></div>

</div>

<input type="hidden" class="form-control" id="qtags" name="qtags"
value="" />
</div>

<div class="mar-t-1">

<button type="submit" class="btn btn-success">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</form>

</div>

</div>
</div>
</div><!-- 举报 -->
<div class="modal fade panel-report" id="dialog_inform">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
</button>
<h4 class="modal-title">举报内容</h4>
</div>
<div class="modal-body">

<form id="rp_form" class="rp_form" action="https://www.easysap.com/inform/add.html"
method="post">
<input value="" type="hidden" name="qid" id="myqid"> <input
value="" type="hidden" name="aid" id="myaid"> <input value=""
type="hidden" name="qtitle" id="myqtitle">
<div class="js-group-type group group-2">
<h4>检举类型</h4>
<ul>
<li class="js-report-con"><label><input type="radio"
name="group-type" value="1"><span>检举内容</span></label></li>
<li class="js-report-user"><label><input type="radio"
name="group-type" value="2"><span>检举用户</span></label></li>
</ul>
</div>
<div class="group group-2">
<h4>检举原因</h4>
<div class="list">
<ul>
<li><label class="reason-btn"><input type="radio" name="type"
value="4"><span>广告推广</span></label></li>
<li><label class="reason-btn"><input type="radio" name="type"
value="5"><span>恶意灌水</span></label></li>
<li><label class="reason-btn"><input type="radio" name="type"
value="6"><span>回答内容与提问无关</span> </label></li>
<li><label class="copy-ans-btn"><input type="radio" name="type"
value="7"><span>抄袭答案</span></label></li>
<li><label class="reason-btn"><input type="radio" name="type"
value="8"><span>其他</span></label></li>
</ul>
</div>
</div>
<div class="group group-3">
<h4>检举说明(必填)</h4>
<div class="textarea">
<ul class="anslist"
style="display: none; line-height: 20px; overflow: auto; height: 171px;">
</ul>
<textarea name="content" maxlength="200"
placeholder="请输入描述200个字以内">
</textarea>
</div>
</div>
<div class="mar-t-1">

<button type="submit" id="btninform" class="btn btn-success">提交</button>
<button type="button" class="btn btn-default mar-ly-1"
data-dismiss="modal">关闭</button>
</div>
</form>


</div>

</div>
</div>
</div>

<!-- 微信分享 -->
<div class="modal share-wechat animated" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" data-dismiss="modal" class="close">×</button>
</div>
<div class="modal-body">
<h5>打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮</h5>
<div data-url="https://www.easysap.com/q-5559.html" class="qrcode"
title="https://www.easysap.com/q-5559.html">
<canvas width="170" height="170" style="display: none;"></canvas>
<div id="qr_wxcode"></div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>

<!-- 设置付费金额 -->
<div class="modal pay-money animated" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">

<button type="button" data-dismiss="modal" class="close">×</button>
</div>
<div class="modal-body">
<h5>付费偷看金额在0.1-10元之间</h5>
<div class="mar-t-1">

<input type="number" value="0" id="chakanjine" class="form-control" />

</div>
<button id="comfirm_pay" class="btn btn-success mar-t-1">确定</button>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>

<!-- 邀请回答 -->

<div class="modal fade" id="dialog_invate">
<div class="modal-dialog" style="width: 700px; top: -30px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
</button>
<h4 class="modal-title"></h4>
<div class="m_invateinfo">
<span class="m_i_text""> 您已邀请<span class="m_i_persionnum">15</span>人回答
</span> <span data-toggle="popover" data-tip-class="popover-info"
data-html="ture" data-placement="bottom" data-content=""
title="我的邀请列表" class="m_i_view">查看邀请</span>

<div class="m_i_warrper">
<input data-qid="5559" type="text"
id="m_i_searchusertxt" class="m_i_search" placeholder="搜索你想邀请的人">
<i class="fa fa-search"></i>
</div>

</div>
</div>
<div class="modal-body">
<!-- 邀请回答 -->
<ul class="trigger-menu m_invate_tab"
data-pjax-container="#list-container">
<li class="active" data-qid="5559" data-item="1"><a
href="javascript:">擅长该话题的人</a></li>
<li class="" data-qid="5559" data-item="2"><a
href="javascript:"> 回答过该话题的人</a></li>
<li class="" data-qid="5559" data-item="3"><a
href="javascript:">我关注的人</a></li>

</ul>
<!-- 邀请回答列表 -->
<div class="m_invatelist"></div>

</div>

</div>
</div>
</div>
   <link rel="stylesheet" type="text/css" href="https://www.easysap.com/static/js/neweditor/code/styles/tomorrow-night-eighties.css">
    <script src="https://www.easysap.com/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script>
<script>hljs.initHighlightingOnLoad();</script>

<script>
    function setcode(){
        var _html='';
    	  document.querySelectorAll('pre code').forEach((block) => {
        	  var _tmptext=$.trim($(block).text());
        	  if(_tmptext!=''){
        		  _html=_html+_tmptext;
        		  console.log(_html);
        	  }
    		 
    		  
    		 
      	  });
    	  $("#tpl_content").val(_html);

    }
 
</script>
<script>
  getquestioncaozuo(1,5559);
  getquestioncaozuo(2,5559);
  getquestioncaozuo(3,5559);
  getquestioncaozuo(4,5559);
  $(".btnshowall").click(function(){
    $(".shortquestioncontent").toggle();
    $(".hidequestioncontent").toggle();
  });


  $("#normal-comment-list .answercontent").each(function(){
if($(this).height()>150){
$(this).parent().find(".readmore").show();
}else{
$(this).parent().find(".readmore").hide();
}
});

    var needcode=0;
      var g_id = 6;
  var qid = 5559;
  function listertext(){
  	 var _content=$("#anscontent").val();
  	 if(_content.length>0&&g_id!=1){

  		 $(".code_hint").show();
  	 }else{
  		 $(".code_hint").hide();
  	 }
  }
    var mobile_localyuyin=0;
  //  var userAgent = window.navigator.userAgent.toLowerCase();
//  $.browser.msie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
 // if($.browser.msie8==true){
//  var mobile_localyuyin=0;
 // }
  var targetplay=null;
  function checktagsubmit(){
if(gettagsnum()<=0){
alert("请设置标签");
return false;
}
if(gettagsnum()>5){
    alert("最多添加5个标签");
    return false;
}
 var _tagstr=gettaglist();
 $("#qtags").val(_tagstr);
 
  }
  $(".txt_taginput").on(" input propertychange",function(){
 var _txtval=$(this).val();
 if(_txtval.length>1){

 //检索标签信息
 var _data={tagname:_txtval};
 var _url="https://www.easysap.com/tags/ajaxsearch.html";
 function success(result){
 console.log(result)
 if(result.code==200){
 console.log(_txtval)
  $(".tagsearch").html("");
for(var i=0;i<result.taglist.length;i++){

 var _msg=result.taglist[i].tagname
 
           $(".tagsearch").append('<div class="tagitem" tagid="'+result.taglist[i].id+'">'+_msg+'</div>');
}
$(".tagsearch").show();
$(".tagsearch .tagitem").click(function(){
var _tagname=$.trim($(this).html());
var _tagid=$.trim($(this).attr("tagid"));
if(gettagsnum()>=5){
alert("标签最多添加5个");
return false;
}
if(checktag(_tagname)){
alert("标签已存在");
return false;
}
$(".dongtai .tags").append('<div class="tag"><span tagid="'+_tagid+'">'+_tagname+"</span><i class='fa fa-close'></i></div>");
$(".dongtai .tags .tag  .fa-close").click(function(){
$(this).parent().remove();
});
$(".tagsearch").html("");
$(".tagsearch").hide();
$(".txt_taginput").val("");
});
        
 }
 
 }
 ajaxpost(_url,_data,success);
 }else{
$(".tagsearch").html("");
$(".tagsearch").hide();
 }
})
function checktag(_tagname){
var tagrepeat=false;
$(".dongtai .tags .tag span").each(function(index,item){
var _tagnametmp=$.trim($(this).html());
if(_tagnametmp==_tagname){
tagrepeat=true;
}
})
return tagrepeat;
}
function gettaglist(){
var taglist='';
$(".dongtai .tags .tag span").each(function(index,item){
var _tagnametmp=$.trim($(this).attr("tagid"));
taglist=taglist+_tagnametmp+",";

})
taglist=taglist.substring(0,taglist.length-1);

return taglist;
}
function gettagsnum(){
      return $(".dongtai .tags .tag").length;
}
$(".tagsearch .tagitem").click(function(){
var _tagname=$.trim($(this).html());
if(gettagsnum()>=5){
alert("标签最多添加5个");
return false;
}
if(checktag(_tagname)){
alert("标签已存在");
return false;
}
$(".dongtai .tags").append('<div class="tag"><span>'+_tagname+"</span><i class='fa fa-close'></i></div>");
$(".dongtai .tags .tag  .fa-close").click(function(){
$(this).parent().remove();
});
$(".tagsearch").html("");
$(".tagsearch").hide();
$(".txt_taginput").val("");
});
$(".dongtai .tags .tag  .fa-close").click(function(){
$(this).parent().remove();
});
  $(".yuyinplay").click(function(){
  	targetplay=$(this);
  	var _serverid=targetplay.attr("id");
  	   if(_serverid == '') {
  			alert('语音文件丢失');
             return;
         }
  	   $(".wtip").html("免费偷听");
  	   targetplay.find(".wtip").html("播放中..");
  	   if(mobile_localyuyin==1){
  		 $(".htmlview").removeClass("hide");
   $(".ieview").addClass("hide");

  		   var myAudio =targetplay.find("#voiceaudio")[0];
  	  	  // myAudio.pause();
  	  	   //myAudio.play();
  	  	   if(myAudio.paused){
  	  		   targetplay.find(".wtip").html("播放中..");
  	             myAudio.play();
  	         }else{
  	      	   targetplay.find(".wtip").html("暂停..");
  	             myAudio.pause();
  	         }
  	  	   function endfun(){ targetplay.find(".wtip").html("播放结束");alert("播放结束!")}
  	  	   var   is_playFinish = setInterval(function(){
  	             if( myAudio.ended){

  	          	   endfun();
  	  	                    window.clearInterval(is_playFinish);
  	             }
  	     }, 10);
  	   }else{

  		 $(".ieview").removeClass("hide");
  		   $(".htmlview").addClass("hide");
  	   }




  })
function deleteanswer(current_aid){
  if(confirm("是否删除此回答?")){
window.location.href=g_site_url + "index.php" + query + "question/deleteanswer/"+current_aid+"/5559";

  }

}
  function adoptanswer(aid) {

      $("#adopt_answer").val(aid);

      $('#dialogadopt').modal('show');
}
  //编辑标签
  function edittag() {
 	 $('#dialog_tag').modal('show');

 }
  if(typeof($(".show-content").find("img").attr("data-original"))!="undefined"){
var imgurl=$(".show-content").find("img").attr("data-original");
$(".show-content").find("img").attr("src",imgurl);
}

$(".show-content,.answercontent").find("img").attr("data-toggle","lightbox").attr("data-lightbox-group",Date.parse( new Date() ).toString());

  var category1 = [["42","S/4HANA"],["17","Fiori"],["45","UI5"],["20","HANA"],["2","ABAP"],["16","FICO"],["47","SD"],["26","MM"],["36","PP"],["34","PM"],["37","PS"],["54","WM"],["38","QM"],["12","CRM"],["8","BPC"],["9","BPM"],["11","BW"],["7","BO"],["32","PI"],["44","PO"],["6","Basis"],["46","SCM"],["49","SRM"],["21","HCM"],["24","Logistics Execution"],["33","PLM"],["15","EWM"],["41","RPA"],["4","Ariba"],["50","SuccessFactors"],["55","Workflow"],["3","APO"],["5","B1"],["10","BSP"],["13","DATA"],["22","HTML5"],["53","Web Dynpro"],["18","GRC"],["43","SAP Cloud"],["19","GTS"],["23","Hybris"],["25","Lumira"],["27","Mobile"],["28","NetWeaver"],["1","SAP Industry Solutions"],["35","PORTAL"],["48","SOLMAN"],["52","UI"],["59","Machine Learning"],["56","Big Data"],["57","Blockchain"],["58","Training"],["31","Others"]];
  var category2 = [];
  var category3 = [];
  var selectedcid = "45,0,0";
  //修改分类
  function change_category() {
      var category1 = $("#category1 option:selected").val();
              var category2 = $("#category2 option:selected").val();
              var category3 = $("#category3 option:selected").val();
              if (category1 > 0) {
      $("#categoryid").val(category1);
      }
      if (category2 > 0) {
      $("#categoryid").val(category2);
      }
      if (category3 > 0) {
      $("#categoryid").val(category3);
      }
      $("#catedialog").model("hide");
              $("form[name='editcategoryForm']").submit();
      }
  //投诉
  function openinform(qid ,qtitle,aid) {
  $("#myqid").val(qid);
  $("#myqtitle").val(qtitle);
  $("#myaid").val(aid);
 	 $('#dialog_inform').modal('show');

 }
  $(".showcommentid").each(function(){
       var dataid=$(this).attr("data-id");
       show_comment(dataid);
  });
  function show_comment(answerid) {
      if ($("#comment_" + answerid).css("display") === "none") {
      load_comment(answerid);
              $("#comment_" + answerid).slideDown();
      } else {
      $("#comment_" + answerid).slideUp();
      }
      }
  //添加评论
  function addcomment(answerid) {
  var content = $("#comment_" + answerid + " input[name='content']").val();
  var replyauthor = $("#comment_" + answerid + " input[name='replyauthor']").val();
 
  if (g_uid == 0){
  
      login();
      return false;
  }
  if (bytes($.trim(content)) < 5){
  alert("评论内容不能少于5字");
          return false;
  }
  $.ajax({
  type: "POST",
          url: "https://www.easysap.com/answer/addcomment.html",
          data: "content=" + content + "&answerid=" + answerid+"&replyauthor="+replyauthor,
          success: function(status) {
          if (status == '1') {
          $("#comment_" + answerid + " input[name='content']").val("");
                  load_comment(answerid);
          }else{
          	if(status == '-2'){
          		alert("问题已经关闭,无法评论");
          	}
          }
          }
  });
  }
  
  //删除评论
  function deletecomment(commentid, answerid) {
  if (!confirm("确认删除该评论?")) {
  return false;
  }
  $.ajax({
  type: "POST",
          url: "https://www.easysap.com/answer/deletecomment.html",
          data: "commentid=" + commentid + "&answerid=" + answerid,
          success: function(status) {
              
          if (status == '1') {
          load_comment(answerid);
          }else{
                alert(status);
          }
          
          }
  });
  }
  //加载评论
  function load_comment(answerid){
  $.ajax({
  type: "GET",
          cache:false,
          url: "https://www.easysap.com/index.php?answer/ajaxviewcomment/" + answerid,
          success: function(comments) {
          $("#comment_" + answerid + " .my-comments-list").html(comments);
          }
  });
  }

  function replycomment(commentauthorid,answerid){
      var comment_author = $("#comment_author_"+commentauthorid).attr("title");
      $("#comment_"+answerid+" .comment-input").focus();
      $("#comment_"+answerid+" .comment-input").val("回复 "+comment_author+" :");
      $("#comment_" + answerid + " input[name='replyauthor']").val(commentauthorid);
  }
$(function(){
  initcategory(category1);
          fillcategory(category2, $("#category1 option:selected").val(), "category2");
          fillcategory(category3, $("#category2 option:selected").val(), "category3");
        	var qrurl="https://www.easysap.com/q-5559.html";
//微信二维码生成
$('#qr_wxcode').qrcode(qrurl);
     //显示微信二维码
     $(".share-weixin").click(function(){
    	 $(".share-wechat").show();
     });
     //关闭微信二维码
     $(".close").click(function(){
    	 $(".share-wechat").hide();
    	 $(".pay-money").hide();
     });
  


})


                </script>
<div id="usercard" style="position:absolute;z-index:999999999;"></div>
   <script src="https://www.easysap.com/static/js/jquery.lazyload.min.js" type="text/javascript"></script>
<script>

   

                    $("img.lazy").lazyload({effect: "fadeIn" });

</script>

  <div class="side-tool" id="to_top"><ul><li data-placement="left" data-toggle="tooltip" data-container="body" data-original-title="回到顶部" >
    <a href="#" class="function-button"><i class="fa fa-angle-up"></i></a>
    </li>



      </ul></div>
      <script>
window.onload = function(){
  $(".edui-upload-video").attr("preload","");
  var oTop = document.getElementById("to_top");

  var screenw = document.documentElement.clientWidth || document.body.clientWidth;
  var screenh = document.documentElement.clientHeight || document.body.clientHeight;
  window.onscroll = function(){
    var scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
 
    if(scrolltop<=screenh){
    	oTop.style.display="none";
    }else{
    	oTop.style.display="block";
    }
    if(scrolltop>30){
     
    	$(".scrollshow").show();
    }else{
    	$(".scrollshow").hide();
    }
  }
  oTop.onclick = function(){
    document.documentElement.scrollTop = document.body.scrollTop =0;
  }
}

</script>

    <footer id="footer">
        <div class="footer-wrapper">
            <div class="footer-wrapper-top">
                <div class="footer-wrapper-top-left">
                    <a href="https://www.easysap.com/tags.html"><i class="hide"></i>标签大全</a>
                    <a href="https://www.easysap.com/new.html" >站内问题</a>
                    <a href="https://www.easysap.com/topic/default.html" >专栏文章</a>
                    <a href="https://www.easysap.com/expert/default.html">站内专家</a>
                    <a href="https://www.easysap.com/category/viewtopic/hot" >站内话题</a>
                    <a href="https://www.easysap.com/note/list.html" >站内公告</a>
                     <a href="https://www.easysap.com/rule/index.html">财富值规则</a>
                       <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?91cd836d35676d254ee158461ecf506f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>                     
                </div>
               
            </div>
            
                        
         
           
            <div class="footer-wrapper-bottom space-footer-bottom">
                <a href="http://www.12377.cn/" target="_blank">网上有害信息举报专区</a>
                    <i></i>
                    <a href="https://beian.miit.gov.cn/" target="_blank">京ICP备2021023650号</a>
                <i></i>
                <span ><a href="https://www.easysap.com/rss/articlelist.xml" target="_blank">站内文章地图xml</a></span>
                <i></i>
                <span><a href="https://www.easysap.com/rss/list.xml" target="_blank">站内问答地图xml</a></span>
                <i></i>
                <span><a href="https://www.easysap.com/rss/userspace.xml" target="_blank">站内作者地图xml</a></span>
               <i></i>
                <span><a href="https://www.easysap.com/rss/tag.xml" target="_blank">站内标签地图xml</a></span>
            
              <!--<span class="copyrightLink">Copyright © 2024 <a href="https://www.easysap.com/" target="_blank">EasySAP</a></span>-->
              <span class="copyrightLink">Copyright © 2024 <a href="https://www.easysap.com/" target="_blank">EasySAP</a></span>
            </div>
        </div>
    </footer>

</div>

</body>
</html>