Pārlūkot izejas kodu

Автоматическая ширина эдитора

Добавил автоматическую установку ширины в inplace edit
Denis V. Dedkov 10 gadi atpakaļ
vecāks
revīzija
20f6d8eab2
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      asuzr/tables.py

+ 2 - 2
asuzr/tables.py

@@ -17,12 +17,12 @@ class EditableColumn(tables.TemplateColumn):
     main_part = ''
     if object_name == '':
        main_part = '''
-                    {{% inplace_edit "record.{field}" auto_height = 1 %}}
+                    {{% inplace_edit "record.{field}" auto_height = 1, auto_width = 1 %}}
                    '''
     else:
        main_part = '''
                     {{% if record.{object_name} %}}
-                      {{% inplace_edit "record.{object_name}.{field}" auto_height = 1 %}}
+                      {{% inplace_edit "record.{object_name}.{field}" auto_height = 1, auto_width = 1 %}}
                     {{% endif %}}
                    '''
     template = template.format(main_part = main_part)