Hi,
How to update or toggle elements. see the following code.
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement)
{
this.mainContainer = document.createElement("div");
//this.mainContainer.classList.add("SimpleTable_MainContainer_Style");
container.appendChild(this.mainContainer);
let clickMe:HTMLButtonElement;
clickMe = document.createElement("button");
clickMe.setAttribute("type", "button");
clickMe.innerText = "ClickMe";
clickMe.id="ClickMe";
this.mainContainer.appendChild(clickMe);
clickMe.addEventListener("click", this.addNewButtonClick.bind(this));
}
private addNewButtonClick(event: Event): void {
var currentButton=document.getElementById('ClickMe') as HTMLButtonElement;
currentButton.innerText="done";
}
Nothing is happening when I click the button. I debugged using the browser, it is getting into the method but the element is not updating. I tried to set style, toggle() etc.
But this is working when am using the PCFin the local test harness..
Please advise.
Many Thanks