You need to sign in to do that
Don't have an account?
Yashita Goyal 12
Get Selected option value of rows in a table getting created dynamically having class name of select option
Am getting issue in retrieving selected select option value in lightning controller. The table rows are craeted dynamically assigning class name select option table cell.
Below is the code am using in lightning controller:
However am able to get output on console but with error on screen:
Any help will be appreciated.
Thanks
Yashita
Below is the code am using in lightning controller:
var tableId = document.getElementById("myTable"); var rowCount = tableId.rows.length; var e = document.getElementsByClassName("slds-select"); for (var i = 0; i < rowCount; i++){ var tempo = e[i].options[e[i].selectedIndex]; var selOperator = tempo.value; console.log('selOperator: '+selOperator); }
However am able to get output on console but with error on screen:
Any help will be appreciated.
Thanks
Yashita
One of the things that I like the best about LC, is that Salesforce has brought OOP to the web development!
2. I can't use document.getElementById() as am creating rows dynamically and am only setting class name. So, I need solution which uses document.getElementByClassName()
Thanks :)