Filters don't pass data-m-key
TomJLynch opened this issue · 2 comments
On line 135 of metron.lists.ts the variable key can be set to attribute data-m-key instead of the default attribute name. I took advantage of that to fix a filter whose source data didn't have a column name that matched the name attribute, causing it to fill the select option values with "undefined". However, the on change event handler for the filter doesn't realize that the select element's data-m-key may be different than the name attribute. It's necessary to submit a filtered request using the name attribute, because that name matches the filter parameter on Get method in the web service. So, if you use a data-m-key that doesn't match the name, the Get call doesn't receive a value in the desired filter parameter.
Don't allow the use of data-m-key? Or force the key in fil[key] to always be the name attribute? Something else?
What is set as the data-m-key must be something that the API endpoint is expecting since when the filter is changed, it updates the filter object that gets passed over the query string.
We probably need a warning logged to the console when somebody sets a data-m-key that isn't expected by the API endpoint.
Added warning prior to connecting to the API endpoint.