Bootstrap Modal not working in SugarEnt 14.0.0

Hello folks,

The modal is functioning in Sugar Ent Version 13.0.2 but is not working for 14.0.0.

Using the following code:

custom\Extension\application\Ext\JSGroupings\new_js_grouping.php

Fullscreen
1
2
3
4
5
6
$js_groupings[] = $sugar_grp_sidecar = array_merge(
$sugar_grp_sidecar,
array(
'custom/file1.js' => 'include/javascript/sugar_sidecar.min.js',
)
);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

custom\file1.js

$('body').append('<div id="VRT_WhatsAppBOX" class="modal hide in" role="dialog" >testing</div>');

function sendwhatsapp(phone_value,id,modulename)
{
      $('#VRT_WhatsAppBOX').modal('toggle');
}

When the above sendwhatsapp function is called, it shows an error. Additionally, the modal close button below also not working.

<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

Its opening but not showing above console error and close modal also not working.

 

 

Parents
  •  can you please expand upon your use case? It's unclear from the error message what your use case is

  • Hello  

    I am adding div block using Jsgrouping to the page. and adding icon beside mobile for open the same div for sending whatsapp.

    Once clicking on Icon, it will open that div like below.

    So same thing working till 13.0 and not working in 14 version. i believe its not working after 13.3

    All the code sample available in question.

  • For my integrations with SMS (Twilio, WhatsApp, Plivio, etc), we have added a custom/clients/base/fields/phone/phone.js and added custom/clients/base/fields/phone/sms-detail.hbs and custom/clients/base/fields/phone/sms-list.hbs

    In the phone.js we determine if we would like to use the custom HBS.

    In the HBS we have added our icons, etc.

  •  

    Okay, how you manage popup/modal like i am using above.

    Any idea on why bootstrap modal not working with below command in Jsgrouping.

    $('#VRT_WhatsAppBOX').modal('toggle');

Reply Children
  • Since we have a customized phone.js file, when the "button" is clicked, we can link an event to the click action. In our scenario, instead of opening a modal, we open a drawer. It's worth noting that Sugar doesn't utilize modals. Therefore, to maintain consistency with the application's design, opening a drawer is preferred.

    Another option would be to review how, the DocMerge functionality works and it dynamically adds Doc Merge and Doc Merge to PDF options and has a "global" event