2017-09-25 4 views
0

enter image description hereLiferayのAUI自動フィールドはボタンが<strong>うまく</strong>が機能していない削除

AUIオートフィールドを働いていないボタンを削除します。ただし、そのままボタンを追加してください。ここで

私が使用している構成コードです:

AUI().use('liferay-auto-fields',function(A) { 
    new Liferay.AutoFields({ 
      contentBox: '#clientContact', 
      fieldIndexes: namespace + 'clientContactIndexs', 
      on: { 
       'init':function(event) { 
        console.log('init'); 
       }, 
       'clone': function(event) { 
        console.log('clone'); 
        console.log(event); 
       }, 
       'delete': function(event) { 
        console.log('delete'); 
        console.log(event); 
       } 
      } 
     }).render(); 
    }); 

HTMLコード:

<div id="clientContact">   
      <div class="lfr-form-row lfr-form-row-inline"> 
       <div class="row-fields"> 
        <aui:row> 
         <aui:column cssClass="col-xs-12 col-md-4"> 
          <aui:input name="clientContactName1" id="clientContactName1" label="" placeholder="client.contact.name"> 
           <aui:validator name="required"></aui:validator> 
          </aui:input> 
         </aui:column> 
         <aui:column cssClass="col-xs-12 col-md-4"> 
          <aui:input name="clientContactMobile1" id="clientContactMobile1" label="" placeholder="mobile"> 
          </aui:input> 
         </aui:column> 
         <aui:column cssClass="col-xs-12 col-md-4"> 
          <aui:input name="clientContactEmail1" id="clientContactEmail1" label="" placeholder="email"> 
          </aui:input> 
         </aui:column> 
        </aui:row> 
       </div> 
      </div> 
     </div> 

を、私は欠けているものはありますか? ありがとう、

答えて

0

この問題を解決する方法を見つけました。 私はこれを知っていますは最高の解決策ではありませんそしてはどんな手作業のコードなしで正しく動作するはずです。しかし、すべてがうまくいて、あなたのコードは動作していません。THENとの場合は、以下のコードを試してみてください。

$(".delete-row").click(function(){ 
    if($("#clientContact > .lfr-form-row").length > 1){ 
      $(this).parent().parent().parent().remove(); 
    } 
}); 

削除ボタンがクリックされた行が削除されます。

関連する問題