coffeescript-ui
Version:
Coffeescript User Interface System
80 lines (64 loc) • 1.72 kB
text/coffeescript
###
* coffeescript-ui - Coffeescript User Interface System (CUI)
* Copyright (c) 2013 - 2016 Programmfabrik GmbH
* MIT Licence
* https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
###
class Demo.FormLayoutDemo extends Demo
getGroup: ->
"Test"
display: ->
form_options =
class: "cui-form-layout-demo-example-default"
form_options =
class: "cui-form-layout-demo-example-maximize-center"
form_options =
class: "cui-form-layout-demo-example-maximize-right"
createExampleForm: (form_options) ->
select_options = [
text: "data name 1"
value: 1
,
text: "data name 2"
value: 2
]
form_data =
width_type: 1
option: true
default_form_options =
type: CUI.Form
horizontal: false
data: form_data
fields: [
type: CUI.Select
name: "width_type"
form:
label: "Layout"
options: select_options
,
type: CUI.Checkbox
text: "option"
name: "option"
form:
label: "Simple Input"
,
placeholder: "INPUT"
type: CUI.Input
name: "simple_input"
form:
label: "text 1"
right:
label: "a simple text input"
]
# add form options to defaults
for key,value of form_options
default_form_options[key] = value
form = CUI.DataField.new(default_form_options)
form.start()
form
Demo.register(new Demo.FormLayoutDemo())