فهرست منبع

improve documentation

Falko Schindler 1 سال پیش
والد
کامیت
71264ef33c
2فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 1 1
      nicegui/elements/json_editor.py
  2. 3 2
      website/documentation/content/json_editor_documentation.py

+ 1 - 1
nicegui/elements/json_editor.py

@@ -54,7 +54,7 @@ class JsonEditor(Element, component='json_editor.js', exposed_libraries=['lib/va
         Otherwise, the method is executed without waiting for a response.
 
         :param name: name of the method
-        :param args: arguments to pass to the method
+        :param args: arguments to pass to the method (must strings containing JavaScript expressions)
         :param timeout: timeout in seconds (default: 1 second)
         :param check_interval: interval in seconds to check for a response (default: 0.01 seconds)
 

+ 3 - 2
website/documentation/content/json_editor_documentation.py

@@ -38,8 +38,9 @@ def methods_demo() -> None:
     }
     editor = ui.json_editor({'content': {'json': json}})
 
-    ui.button('Expand All', on_click=lambda: editor.run_editor_method('expand', 'path => true'))
-    ui.button('Collapse All', on_click=lambda: editor.run_editor_method('expand', 'path => false'))
+    ui.button('Expand', on_click=lambda: editor.run_editor_method('expand', 'path => true'))
+    ui.button('Collapse', on_click=lambda: editor.run_editor_method('expand', 'path => false'))
+    ui.button('Readonly', on_click=lambda: editor.run_editor_method('updateProps', r'{readOnly: true}'))
 
     async def get_data() -> None:
         data = await editor.run_editor_method('get')