Multi-row editor doesn't render value
Multi-row editor doesn't render value
Hello,
I found problem with using multi-row edit option. It doesn't call render function to get initial value.
Datatable column:
[{"name":1,"data":"member_first_name","title":"First","orderable":true,"searchable":true},{"name":2,"data":"timestamp_added","title":"Joined","render":function(data,type,full,meta){ dt = moment.unix(full["timestamp_added"]); return dt.unix() > 0 ? dt.tz("America/New_York").format("MM/DD/YYYY hh:mm A") : "Never"; },"orderable":true,"searchable":true}]
Editor field:
[{"name":"member_first_name","label":"First"},{"name":"timestamp_added","label":"Joined","type":"datetime","opts":{"format":"mm/dd/yyyy HH:ii P","startDate":"01/01/2010 12:00 AM","endDate":"03/13/2018 11:59 PM","fontAwesome":true}}]
Post data:
multi-editor mode:
action edit
data[618558][member_first_name] Sam
data[618558][timestamp_added] 1520762406
data[618559][member_first_name] Test
data[618559][timestamp_added] 1520841485
Same table using single row editor:
data[618560][member_first_name] Jeffrey
data[618560][timestamp_added] 03/12/2018+02:44+PM
Expected post value for timestamp_added is 03/12/2018+02:44+PM, not integer
Answers
Editor v1.6.5, Datatables v1.10.13
The render function is never called for Editor.
columns.render
is DataTables specific, while Editor will always use the underlying data.Having said that, there does appear to be something going on with your data, but I'm not sure what. Can you link to a page showing the issue please?
Allan
Thanks for your reply. I did additional investigation and found issue why it happens. In multi-edit mode it doesn't call "set" method for editor field plugin (in our case datetime - editor.datetimepicker.js), this why it doesn't convert timestamp into formatted date. I think we should keep same value for normal and multi-editor
Can you give me a link to a page showing the issue please?
Thanks,
Allan