You must distinguish between the data to be displayed in HTML in the datatable widget and the data to be edited in a form.
For example, if you want to format the customer name in HTML in the datatable, your controller action should return both a property named 'customer_name_for_display' and another property named 'customer_name'. The 'customer_name_for_display' property name is the one used for the datatable (for the 'field' property), the 'customer_name' property name is the one used for the input field ('name' attribute) in the data form.