You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
922 B
33 lines
922 B
Demo.CodeEditor = BI.inherit(BI.Widget, { |
|
props: { |
|
baseCls: "demo-editor" |
|
}, |
|
render: function () { |
|
var editor = BI.createWidget({ |
|
type: "bi.code_editor", |
|
cls: "mvc-border", |
|
width: 600, |
|
height: 400 |
|
}); |
|
BI.createWidget({ |
|
type: "bi.vertical", |
|
element: this, |
|
hgap: 30, |
|
vgap: 20, |
|
items: [editor, { |
|
type: "bi.button", |
|
text: "getValue", |
|
handler: function () { |
|
BI.Msg.toast(JSON.stringify(editor.getValue())); |
|
} |
|
}, { |
|
type: "bi.button", |
|
text: "setValue", |
|
handler: function () { |
|
editor.setValue("测试数据"); |
|
} |
|
}] |
|
}); |
|
} |
|
}); |
|
BI.shortcut("demo.code_editor", Demo.CodeEditor); |