Skip to main content
deleted 8 characters in body
Source Link
Chaithra K N
  • 285
  • 1
  • 5
  • 18

I have below code where i am trying to display data in a table format based the html element stored in a field.

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
    <thead aura:id="t1"></thead>
    <tbody aura:id="t2"></tbody>
</table>

var t1 = component.find("t1");
var t2 = component.find("t2");
var thead= '', tbody= '';
for (var i = 0, listLength = tableRowList.length; i < listLength; i++) {
    if (tableRowList[i].IsHeader__c) {
        thead=thead+tableRowList[i].DTE_Row__c;Row__c;
    } else {
        tbody=tbody+tableRowList[i].DTE_Row__c;Row__c;
    }
}
t1.getElement().innerHTML += thead;
t2.getElement().innerHTML += tbody;
console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

I have below code where i am trying to display data in a table format based the html element stored in a field.

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
    <thead aura:id="t1"></thead>
    <tbody aura:id="t2"></tbody>
</table>

var t1 = component.find("t1");
var t2 = component.find("t2");
var thead= '', tbody= '';
for (var i = 0, listLength = tableRowList.length; i < listLength; i++) {
    if (tableRowList[i].IsHeader__c) {
        thead=thead+tableRowList[i].DTE_Row__c;
    } else {
        tbody=tbody+tableRowList[i].DTE_Row__c;
    }
}
t1.getElement().innerHTML += thead;
t2.getElement().innerHTML += tbody;
console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

I have below code where i am trying to display data in a table format based the html element stored in a field.

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
    <thead aura:id="t1"></thead>
    <tbody aura:id="t2"></tbody>
</table>

var t1 = component.find("t1");
var t2 = component.find("t2");
var thead= '', tbody= '';
for (var i = 0, listLength = tableRowList.length; i < listLength; i++) {
    if (tableRowList[i].IsHeader__c) {
        thead=thead+tableRowList[i].Row__c;
    } else {
        tbody=tbody+tableRowList[i].Row__c;
    }
}
t1.getElement().innerHTML += thead;
t2.getElement().innerHTML += tbody;
console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

added 70 characters in body
Source Link
Sebastian Kessel
  • 13.2k
  • 12
  • 38
  • 61

I have below code where i am trying to display data in a table format based the html element stored in a field.

var t1 = component.find("t1"); var t2 = component.find("t2"); var thead= '', tbody= ''; for (var i = 0, listLength = tableRowList.length; i < listLength; i++) { if (tableRowList[i].IsHeader__c) { thead=thead+tableRowList[i].DTE_Row__c; } else { tbody=tbody+tableRowList[i].DTE_Row__c; } } t1.getElement().innerHTML += thead; t2.getElement().innerHTML += tbody; console.log('@@@@',t1.getElement().innerHTML);

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
    <thead aura:id="t1"></thead>
    <tbody aura:id="t2"></tbody>
</table>

var t1 = component.find("t1");
var t2 = component.find("t2");
var thead= '', tbody= '';
for (var i = 0, listLength = tableRowList.length; i < listLength; i++) {
    if (tableRowList[i].IsHeader__c) {
        thead=thead+tableRowList[i].DTE_Row__c;
    } else {
        tbody=tbody+tableRowList[i].DTE_Row__c;
    }
}
t1.getElement().innerHTML += thead;
t2.getElement().innerHTML += tbody;
console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

I have below code where i am trying to display data in a table format based the html element stored in a field.

var t1 = component.find("t1"); var t2 = component.find("t2"); var thead= '', tbody= ''; for (var i = 0, listLength = tableRowList.length; i < listLength; i++) { if (tableRowList[i].IsHeader__c) { thead=thead+tableRowList[i].DTE_Row__c; } else { tbody=tbody+tableRowList[i].DTE_Row__c; } } t1.getElement().innerHTML += thead; t2.getElement().innerHTML += tbody; console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

I have below code where i am trying to display data in a table format based the html element stored in a field.

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
    <thead aura:id="t1"></thead>
    <tbody aura:id="t2"></tbody>
</table>

var t1 = component.find("t1");
var t2 = component.find("t2");
var thead= '', tbody= '';
for (var i = 0, listLength = tableRowList.length; i < listLength; i++) {
    if (tableRowList[i].IsHeader__c) {
        thead=thead+tableRowList[i].DTE_Row__c;
    } else {
        tbody=tbody+tableRowList[i].DTE_Row__c;
    }
}
t1.getElement().innerHTML += thead;
t2.getElement().innerHTML += tbody;
console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?

Source Link
Chaithra K N
  • 285
  • 1
  • 5
  • 18

Locker Service With Inner html tag issue

I have below code where i am trying to display data in a table format based the html element stored in a field.

var t1 = component.find("t1"); var t2 = component.find("t2"); var thead= '', tbody= ''; for (var i = 0, listLength = tableRowList.length; i < listLength; i++) { if (tableRowList[i].IsHeader__c) { thead=thead+tableRowList[i].DTE_Row__c; } else { tbody=tbody+tableRowList[i].DTE_Row__c; } } t1.getElement().innerHTML += thead; t2.getElement().innerHTML += tbody; console.log('@@@@',t1.getElement().innerHTML);

With locker service enabled org, the innerHtml tag is removing the html elements in the data and trying to display the text value.

Any solution for above problem?