Hi all,
I would like to trick function by click on button beside phone number, is it possible to do this?
Look like below:
SugarEnt 7.6
Thanks,
May
Hi all,
I would like to trick function by click on button beside phone number, is it possible to do this?
Look like below:
SugarEnt 7.6
Thanks,
May
Hi
yes , you can do by overriding phone handlebar files.
copy clients/base/fields/phone/*.hbs to custom/clients/base/fields/phone
and then load js file using jsgrouping
custom/Extension/application/Ext/JSGroupings
you can click on that and perform action..
Thank you for your suggest.
I do following you suggest copy all file then do following below link
I found this http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/Extension_Framework/JSGroupings/
in my custom.js we create like this to test:
function one(){
console.log("Hello World!");
}
but no log appear.
How can related my js with custom/clients/base/fields/phone ?
Hi
this is detail.hbs try this
{{#if value}}
<img style="cursor:pointer;float:left;margin-right:5px;padding-top:2px;width:24px" src="custom/themes/default/images/abc.png" onclick="one();">
<div class="ellipsis_inline" data-placement="bottom" title="{{value}}">
{{#if skypeValue}}
<a href="callto:{{skypeValue}}">{{value}}</a>
{{else}}{{value}}
{{/if}}
</div>
{{/if}}
Rebuild JS Grouping Files
Quick Repair & Rebuild
Why we not copy phone.js from clients/base/fields/phone/
I got this message in console log:
'//@ sourceURL' and '//@ sourceMappingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead.
It's make my phone number disappear.
What I do wrong or I miss something ?
My code below:
detail.hbs same as you.
in /custom/Extension/application/Ext/JSGroupings/newGrouping.php
<?php
//creates the file cache/include/javascript/newGrouping.js
$js_groupings[] = $newGrouping = array(
'custom/testJS.js' => 'include/javascript/newGrouping.js',
);
in custom/testJS.js
function one(){
console.log("Hello World!");
}
in my /custom/clients/base/fields/phone has 4 files .hbs
- detail.hbs
- disabled.hbs
- edit.hbs
- list.hbs
Hi
Change your JsGrouping file with this
$js_groupings[] = $sugar_grp_sidecar = array_merge($sugar_grp_sidecar,array(
'custom/testJS.js' => 'include/javascript/sugar_sidecar.min.js',
)
);
Rebuild JS Grouping Files
Quick Repair & Rebuild
Work ! yeahh
Many thanks to you Mehul Bhandari I really appreciate.
Mehul Bhandari Can I ask you again how to get ID from view when we click on bottom.
I would like to get ID to do something.
I saw how to pass parameter to view and it need to modify phone.js
I put code below in phone.js but it return undefined
loadData: function (options) {
myData = new Object();
myData.userID = app.user.id;
this.myData = myData;
}
in detail.hbs in put like this:
onClick"one({{myData}});"
Hi Autchara
onclick="one('{{value}}','{{module}}','{{model.id}}');"
value of field
module name
record id
Thanks for helping me again. I owe you one!