bug with date time picker widget in list editable
the date time picker widget does not work when used in the list editable format..it works without any issues on the form..also the date picker has no issues..only the date time picker does not work in the list editable format..is some one else also facing the same problem..I have posted a small you tube video with the error ... https://www.youtube.com/watch?v=ke3XRgkodyw
anyone else facing the same error..??
Hi, you can check the http://demo.xadmin.io/host/host/ the edit field guarantee date date picker widget works fine
Hi sshwfc..that is the date picker..when it is just the date,it works perfectly fine..however as shown in my video,the date and time picker does not work in the list editable option..i did not see any option of the demo site for date and time both in the list editable to test this..there is only date picker which works without any issues..request you to please look into this at the earliest..
OK, I see. The time picker maybe miss some js files.
I have tried checking this using Chrome DOM inspector but I am not sure which files are missing..do you know what the problem is or what files are missing..the date time picker works fine otherwise..it has no issues on the form edit page..however on the list edit page,it does not work..
any help on how to fix this ??
Hi sshwfc..any update on when you plan to fix this bug..
this bug is in 'xadmin/xadmin/plugins/editable.py' line 110 EditPatchView.post() .
check this function when it gets keys in POST.keys(). the DateTimeField or time picker in POST key is explode to array, like "key_0" means the key of data "YY-MM-DD" and "key_1" means the key of data "HH-mm-ss", so the key can not match in POST.keys()
You can write like this
fields = set()
for f in request.POST.keys():
if f in model_fields:
fields.add(f)
elif f in FIELDS_EDITABLE_IN_LIST_VIEW.keys():
fields.add(FIELDS_EDITABLE_IN_LIST_VIEW[f])
fields = list(fields)
FIELDS_EDITABLE_IN_LIST_VIEW is the Map Dict for request.POST.keys()
Hello dyf0333, I faced same issue that my date time picker doesn’t work in list_editable. I think it can work in your way.But could you please tell me how to set the FIELD_EFITABLE_IN_LIST_VIEW?THX