Announcement

Collapse
No announcement yet.

Could not set element for enum options when createView custom view of enum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Could not set element for enum options when createView custom view of enum

    I'm trying to create custom view of enum field for custom options depend on status field of parent view but I could not know how to set selector.

    here is my code:

    PHP Code:
    ....

    var 
    modalCall this.view.getMetadata().get("clientDefs.Call.modelViews.edit") || "views/modals/edit";
                
    Espo.Ui.warning("Loading..."),
                
    this.view.createView("quickCreate"modalCall, {
                    
    scope"Call",
                    
    attributesattributes,
                    
    headerTextthis.view.model.get('name') + ' → ' this.view.getLanguage().translateOption('Converted','leadStatus','ScotsOption'),
                    
    fullFormDisabled: !0,
                    
    backdrop'static',
                }, (
    callView => {
                    
    //callView.render(),
                    
    callView.createView('paymentType''views/fields/enum', {
                        
    modelcallView.model,
                        
    mode'edit',
                        
    selector'.field[data-name="paymentType"]',
                        
    defs: {
                            
    name'paymentType',
                            
    params: {
                                
    requiredtrue,
                                
    options: ['Deposit''Paid in full'],
                                
    tooltip'Flexible payment type based on parentView'
                            
    }
                        }
                    }, 
    paymentType => {
                        
    paymentType.render()
                    })
                    .
    then(() => {
                        
    callView.render(),


    .... 
    This is my console response when the view created:

    Click image for larger version

Name:	image.png
Views:	85
Size:	15.7 KB
ID:	109800

    Please help me to fix this problem. I'm very headache on this.​

    Thank you everyone

  • #2
    I have done to fix this.

    Thanks you all


    Here is how to fix it:

    PHP Code:
    callView.createView('paymentType''views/fields/enum', {
                        
    //.......
                    
    }, paymentType => {
                        
    callView.once('after:render', () => {
                            
    paymentType.render();
                        });
                    })
    ​ 

    Comment

    Working...
    X