@metalsadman many thanks for this example, it looks very promising. It is rich of examples, how to use quasar components in lob applications. Thank you for sharing it.
Latest posts made by webdev
-
RE: QTable : dynamic slot templates
-
RE: QTable : dynamic slot templates
My idea is to write one single q-table component for different situations or modules. I am getting the configuration of the columns via http request from the backend server. Most of the properties of the columns, could be defined dynamically: style, width and css classes. Also the formatting of the string display.
For rendering a checkbox of a boolean value, normally I would use the conditional v-if.
But I need a more dynamic approach, because I could not define the template of the column in advance:
I don’t know all key-names and the count of boolean values in the definition delivered from the backend server.I hope I’ve become a little more clear. Many thank for any reply.
Tom -
QTable : dynamic slot templates
Hi,
I want to show boolean values in datatable cell as checkbox. So far as I know it is easy for a column IsAdmin to define a cell template as q-td slot:
<q-td slot="body-cell-IsAdmin" slot-scope="props" :props="props"> <q-checkbox label="IsAdmin" value="true"></q-checkbox> </q-td>
But how can I solve this for datables with dynamic columns? Is there a way to define the templates by code?
A universal template is also not the right solution, because there could be more then one column with a boolean value.Many thanks for any advice or hint.
Kind regards,
Tom