buli
2023-06-05 e9b970ea36eea5dcf93fd5b965bf13d7010ce0ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { LightningElement,api } from 'lwc';
 
export default class Jzlookuplightning extends LightningElement {
 
    selectValue = '';
 
 
    @api objectname = '';
    @api fieldname = '';
 
 
    connectedCallback()
    {
        this.setIntervalFn();
 
    }
 
    setIntervalFn()
    {
        setInterval(()=>{
            const inputFields = this.template.querySelectorAll(
                'lightning-input-field'
            );
            if (inputFields) {
                inputFields.forEach(field => {
                
                   if (this.selectValue != field.value) {
                       this.selectValue = field.value
 
                       const getSearchParamsEvent = new CustomEvent('searchchange', {
                        detail: {value:this.selectValue}
                        });
                        this.dispatchEvent(getSearchParamsEvent);
                   }
                });
            }
 
        },500);
 
    }
 
    handleSubmit(event) {
        event.preventDefault();
        console.log(JSON.stringify(event.detail.fields.Hospital__c));
    }
 
    @api setvalue(value){
       this.selectValue = value;
    }
    @api getvalue(){
        return  this.selectValue;
    }
 
    @api todisabled()
    {
        var inputs = this.template.querySelectorAll('lightning-input-field');
        inputs.forEach(inputFile=>{
            inputFile.disabled = true;
        })
        this.ondisabledShow = true;
    }
}