繁体   English   中英

自动重置自定义 Salesforce Lightning 级别字段

[英]Auto reset the Custom Salesforce Lightning Level Fields

我能够使用此线程创建案例类型的完整搜索如何使用 Salesforce 在案例类型中实现完整搜索? ,但现在我需要在选择十字按钮后将自定义 Salesforce Lightning 级别字段自动重置为 null 现在我必须刷新整个 salesforce 页面以清除 salesforce Lightning 组件的级别字段在此处输入图片说明

请告诉我如何在单击交叉后清除 level1 和 level2 和 level3 数据

提前致谢 卡罗琳

改变这个


useSelected: function(component, event, helper) {
        const selection = component.get('v.selection');
        const errors = component.get('v.errors');
        if (selection.length) {
            if(errors.length){  // Clear errors, if any
                component.set('v.errors', []);
            }
            let levels = selection[0].subtitle.split('; ');
            component.find('Level_1__c').set('v.value', levels[0]);
            component.find('Level_2__c').set('v.value', levels[1]);
            component.find('Level_3__c').set('v.value', levels[2]);
        }
    },


useSelected: function(component, event, helper) {
        const selection = component.get('v.selection');
        const errors = component.get('v.errors');
        if (selection.length) {
            if(errors.length){  // Clear errors, if any
                component.set('v.errors', []);
            }
            let levels = selection[0].subtitle.split('; ');
            component.find('Level_1__c').set('v.value', levels[0]);
            component.find('Level_2__c').set('v.value', levels[1]);
            component.find('Level_3__c').set('v.value', levels[2]);
        } else {
            // Somebody "selected" empty option = cleared the search box
            component.find('Level_1__c').set('v.value', '');
            component.find('Level_2__c').set('v.value', '');
            component.find('Level_3__c').set('v.value', '');
        }
    },

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM