mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
ox_lib: Input dialog tweaks
This commit is contained in:
1 parent
bd4e1368c5
commit
fffc860fce
1 file changed
+9
-4
@@ -18,8 +18,12 @@ by setting input fields.
|
||||
-- options: table array (optional - used ONLY with "select" type)
|
||||
-- value: string
|
||||
-- label: string
|
||||
-- default: string (optional - any of the values)
|
||||
-- password: boolean (optional - used ONLY with "input" type)
|
||||
-- icon: string (optional - used ONLY with "input" type)
|
||||
-- placeholder: string (optional - used ONLY with "input" or "number" type)
|
||||
-- default: string or number (optional)
|
||||
-- checked: boolean (optional - used ONLY with "checkbox" type)
|
||||
|
||||
lib.inputDialog(heading, rows)
|
||||
```
|
||||
@@ -70,18 +74,19 @@ end
|
||||
|
||||
```lua
|
||||
local input = lib.inputDialog('Police locker', {
|
||||
{ type = "input", label = "Locker number" },
|
||||
{ type = "input", label = "Locker number", placeholder = "123" },
|
||||
{ type = "checkbox", label = "Some checkbox" },
|
||||
{ type = "input", label = "Locker PIN", password = true, icon = 'lock' },
|
||||
{ type = "checkbox", label = "Some other checkbox" },
|
||||
{ type = "checkbox", label = "Some other checkbox", checked = true },
|
||||
{ type = 'select', label = 'Value select', options = {
|
||||
{ value = 'option1', label = 'Option 1' },
|
||||
{ value = 'option2', label = 'Option 2' },
|
||||
{ value = 'option3', label = 'Option 3'},
|
||||
}}
|
||||
}},
|
||||
{ type = "number", label = "Number counter", default = 12 }
|
||||
})
|
||||
print(json.encode(input, {indent=true}))
|
||||
```
|
||||
 
|
||||
 
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
Reference in new issue
Block a user