Since I face many questions with this new base lightning component: lightning:datatable, I think it is better to have all the questions here in one place:
- I want to have a clickable row for "Click to edit" or "Click to Delete" functionality for each row, or a column for editing each row - how can I achieve that? The available checkboxes are not a good option because they can be multiple selected, and also I need many functionalities for each row (edit, delete, etc.).
I tried to play with the data of the column and set attributes of text type column with the
lightning:formattedText
and of url type column with thelightning:formattedUrl
- according to the doc you can set their attributes with setting in the column objecttypeAttributes: { attributeName: 'value' }
- I could not set any attribute in this way (currency code does work - as in their example, but not all other attributes. Maybe a good example would help me.I created another Question for a problem with a displaying data from a parent field.
I am trying to set the column width with my keyboard and with my mouse (according to the doc), but it is not working - why?
I am trying to set a fixed initial size for some columns, and it is not working - here is my column array:
[{label: 'Id', fieldName: 'Id', type: 'id', sortable: true, initialWidth: "50x"}, {label: 'First Name', fieldName: 'FirstName', type: 'text', sortable: true}, {label: 'Last Name', fieldName: 'LastName', type: 'text', sortable: true}]