I have a simple method along with a simple button click and I’m unable to get the string from the passed in button. For some reason, the object is always a string and I’m not sure why. This is for a MVC App using Telerik. In the below grid, n the button click you’ll see I’m trying to pass in rebind
as a string, however, this is always an object. How do I get the string?
<button onclick="bindGrid('rebind');"> Apply Filters</button>
const activeStatesOptions = document.getElementById("activeStates");
const daysOnMarketOptions = document.getElementById("daysOnMarket");
const prospectStatusOptions = document.getElementById("prospectStatus");
function additionalInfo(rebind) {
if (daysOnMarketOptions.options.length == 0)
{
return {
state: "",
dom: "",
status: "",
rebind: ""
}
}
alert(JSON.stringify(rebind));
alert(rebind);
return {
state: activeStatesOptions.value,
dom: daysOnMarketOptions.value,
status: prospectStatusOptions.value,
rebind: rebind
//prospectStatusOptions.options[prospectStatusOptions.selectedIndex].value
}
}