how to extend DashletView?

I have extended a RecordView and it works perfectly.

SugarPro/custom/modules/XXX/clients/base/views/record/record.js

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
({
extendsFrom: 'RecordView',
initialize: function (options) {
this._super('initialize',[options]);
this.model.on('sync', this.changeField, this);
},
changeField: function() {
var temp_fields = ['active_intergrations_c'];
var accountId = this.model.get("client_tech_stack_accountsaccounts_idb");
$.ajax({
url: "rest/v10/connectedappsapi/getactiveintegrations",
data: { "firmId": accountId },
dataType: "json",
type: "POST",
success: _.bind(function (response) {
if (response && response.status === "success") {
if (!_.isEmpty(response.data)) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


However, when I try to extend the DashletView, I find that the JavaScript is not loading. Any suggestions would be appreciated.
SugarPro/custom/modules/XXX/clients/base/views/recorddashlet/recorddashlet.js

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
({
extendsFrom: 'DashletView',
initialize: function (options) {
this._super('initialize', [options]);
this.collection.on('sync', this.render, this);
console.log('dashlet initialize.');
},
render: function () {
this._super('render');
debugger;
// Render the integration data in the dashlet
var temp_fields = ['active_intergrations_c'];
var accountId = this.model.get("client_tech_stack_accountsaccounts_idb");
console.log('dashlet 2');
$.ajax({
url: "rest/v10/connectedappsapi/getactiveintegrations",
data: { "firmId": accountId },
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


SugarCRM Version 12.0.1 (Build 298 E) (Q2 2022)

Parents
  • more details for the recordview and the dashlet

    for the extension of recordview, it just update the textbox - active_intergrations_c by calling the api

    for the dashlet, it's a Record View Dashlet from above record view.

    I just want to do the same thing as the record view, update the textbox - active_intergrations_c by calling the api when it's load

Reply
  • more details for the recordview and the dashlet

    for the extension of recordview, it just update the textbox - active_intergrations_c by calling the api

    for the dashlet, it's a Record View Dashlet from above record view.

    I just want to do the same thing as the record view, update the textbox - active_intergrations_c by calling the api when it's load

Children
No Data