本文介绍了自动重置自定义 Salesforce Lightning 级别字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够使用此线程创建对案例类型的完整搜索

I was able to create a full search of case types using this thread How To Implement Full Search in Case Type using Salesforce? ,but now i have a need whereI would like to auto reset Custom Salesforce Lightning Level Fields to null after cross button is selectedRight now i have to refresh the entire salesforce page to clear the level fields of salesforce lightning component

请告诉我如何在点击十字后清除level1和level2和level3数据

Please let me know how do I clear the level1 and level2 and level3 data after clicking cross

提前致谢卡罗琳

推荐答案

改变这个


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', '');
        }
    },

这篇关于自动重置自定义 Salesforce Lightning 级别字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:20