You need to sign in to do that
Don't have an account?
Luke Higgins 23
LWC Tree Grid returning error on filter change
I have a lightning-tree-grid with a filter. When I initially select a value in the filter, it works fine. However, when I change the filter to a new value, the previously pulled records remain in the list. I get the error -
"Uncaught (in promise) TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'. at HTMLTableSectionElement.removeChild"
I also want to note that this lwc works perfectly in the test environment. I'm only running into this issue in production.
<lightning-record-edit-form object-api-name="Internal_Requirement__c"> <lightning-input-field name="division" field-name="Division__c" onchange={handleValueChange4} value={division}> </lightning-input-field> </lightning-record-edit-form> <lightning-tree-grid columns={gridColumns} data={treeItems} is-loading={isLoading} key-field="Name" hide-checkbox-column = true ></lightning-tree-grid>js
@wire(getReqs, {division:'$division'}) wiredReqs(value){ console.log(value); this.wiredActivities = value; const { data, error } = value; if (data) { var tempjson = JSON.parse(JSON.stringify(data).split('items').join('_children')); this.treeItems = tempjson; this.isLoading = false; } handleValueChange4(event) { this.division = event.target.value; }apex
@AuraEnabled(cacheable=true) public static List<IntReqWrapper> getReqs(String division, String region, String year, String quarter){ List<Internal_Requirement__c> irList = new List<Internal_Requirement__c>(); String query = 'SELECT Name, Id, Quarter__c, Year__c (SELECT Full_Name__c FROM Internal_Candidate_Submission__r) FROM Internal_Requirement__c WHERE Status__c = \'Open\' '; if(division != ''){ query += ' AND Division__c = \''+division+'\' '; } query += ' ORDER BY Name ASC'; System.debug('q= '+query); irList = Database.query( query ); List<IntReqWrapper> irwrap = new List<IntReqWrapper>(); for(Internal_Requirement__c ir : irList){ IntReqWrapper irWrapper = new IntReqWrapper() ; irWrapper.ReqId = ir.Id ; irWrapper.Name = ir.Name ; irWrapper.Quarter = ir.Quarter__c; List<Items> co = new List<Items>(); for(Internal_Candidate_Submission__c ics : ir.Internal_Candidate_Submission__r){ Items icsWrapp = new Items(); icsWrapp.FullName = ics.Full_Name__c ; co.add(icsWrapp); } irWrapper.items = co; irwrap.add(irWrapper); } return irwrap; }
One issue I see in your SOQL Query with comma missing after Year__c
String query = 'SELECT Name, Id, Quarter__c, Year__c, (SELECT Full_Name__c FROM Internal_Candidate_Submission__r) FROM Internal_Requirement__c WHERE Status__c = \'Open\' ';
The part of the code you shared seems ok to me. I am not sure if anywhere else it is breaking.