Commit 2c034790 authored by Paul Brown's avatar Paul Brown

Fix display of initial value in editable list view

Currently, the editable list view is not setting the default value correctly.

With this change, if the value is "Active", when the user first clicks the editable field it will automatically select "Active" in the dropdown.
parent 8293f443
......@@ -71,8 +71,8 @@ class XEditableWidget(object):
field inside of the FieldList (StringField, IntegerField, etc).
"""
def __call__(self, field, **kwargs):
value = kwargs.pop("value", "")
kwargs.setdefault('data-value', kwargs.pop('value', ''))
kwargs.setdefault('data-role', 'x-editable')
kwargs.setdefault('data-url', './ajax/update/')
......@@ -92,7 +92,7 @@ class XEditableWidget(object):
kwargs = self.get_kwargs(subfield, kwargs)
return HTMLString(
'<a %s>%s</a>' % (html_params(**kwargs), value)
'<a %s>%s</a>' % (html_params(**kwargs), kwargs['data-value'])
)
def get_kwargs(self, subfield, kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment