1

I am calling a js function form this file current.phtml like this

<script type="text/javascript">

 require([ 'jquery', 'jquery/ui'], function($){ $(document).ready(function($) {
   updateAjax();
    }); });
</script>

And this is my function here in js.phtml same module same directory

<script>
function updateAjax(current,returnpaymentid)
    {
        console.log(asdada);
        resetPaymentBlock();
    }
</script>

Here is my customer_edit_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
       <referenceBlock name="customer_form">
         <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\CurrentTransactions" name="tm_cm_current" >
        </block>

         <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\ArchivedTransactions" name="tm_cm_archived" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Archived Transactions</argument>
          </action>
        </block>
        <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\Statements" name="tm_cm_statements" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Statements</argument>
          </action>
        </block>
        <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\PaymentsReceived" name="tm_cm_received" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Payments Received</argument>
          </action>
        </block>



      </referenceBlock>
        <referenceContainer name="before.body.end">
        <block class="TM\CreditManagement\Block\Adminhtml\Transactions\Current" template="TM_CreditManagement::transactions/js.phtml" name="before_js_cm"/>
        </referenceContainer>

</body>

All other are working fine except the last one with template "transactions/js.phtml" this templete is not loading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.