I'm attempting to access the table information of a HubDB table to create a client-side JS map object of column IDs to column labels in order to simplify my code, like so ::
I believe the output of the function could be erroneous. I can access the attributes 'id' and 'name' using any of the above methods, but I cannot access 'type'. I've tried {{ col.type }}, {{ col|attr('type') }} {{ col['type'] }}, {{ col[type] }}, none work, all just give blank output. I also tried using the string filter :: {{ col.type|string }}, which returned 'null'. On inspecting the output using the console, I observed that the type attribute seems to be a constant or similar, as its not wrapped in single quotes in the same way that the 'name' attribute is ::
Is this by design? If so, other than using JS/JQ string functions / regex-ing to parse, can anybody suggest a more streamlined mechanism to access? Speed is of concern as my code is client-side and is executing at render-time.