Inserting foreign field data in detail view field.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gadnuk
    Junior Member
    • Jun 2017
    • 15

    Inserting foreign field data in detail view field.

    Hello,
    I have defined in custom/Espo/Custom/Resources/metadata/entitydef a view for a field. Then the field appear to show fine on my detailed view in terms of format and the fact that it inherits the properties from foreign field.
    Can someone help on inserting data in the field based on a name/id that also appear on the detail view and belongs to the same entity as the field?
    Here is my custom field view:

    Espo.define('custom:views/obiectiv-de-investitii/fields/judet', 'views/fields/link', function (Dep) {
    return Dep.extend({
    template: 'customb-inv/detail',
    setup: function() {
    Dep.prototype.setup.call(this);
    this.listenTo(this.model, 'change:judet', function () {
    actionSetfield();
    }, this);
    },
    actionSetfield: function() {
    $.ajax({
    url: url,
    success: function() {
    var elem = $('#judet');
    elem.html('<h3>Test</h3>');
    }.bind(this)
    });
    },
    afterRender: function() {
    Dep.prototype.afterRender.call(this);
    }
    });
    });


    Thanks.
    Last edited by Gadnuk; 07-04-2017, 01:47 PM.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    actionSetfield(); or this.actionSetfield(); ?
    what does browser console say?

    Comment

    Working...