Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
protogrid:script_library [2017-12-15 09:51] – 46.140.51.3 | protogrid:script_library [2021-01-22 14:50] – [Execute JS on field change] dru | ||
---|---|---|---|
Line 51: | Line 51: | ||
on_load(); | on_load(); | ||
function on_load() { | function on_load() { | ||
- | //do something useful | + | |
+ | | ||
} | } | ||
</ | </ | ||
Line 78: | Line 79: | ||
The function document_ready_trigger tells your card that you want something to happen when a value changes. The call " | The function document_ready_trigger tells your card that you want something to happen when a value changes. The call " | ||
+ | |||
+ | ==== Manipulate Contet of Rich Text Field ==== | ||
+ | |||
+ | <code javascript> | ||
+ | var rich_text_editor = $("#" | ||
+ | |||
+ | var content = rich_text_editor.getDocument().toString(); | ||
+ | rich_text_editor.setSelectedRange([0, | ||
+ | rich_text_editor.setSelectedRange([0, | ||
+ | var current_range = rich_text_editor.getSelectedRange(); | ||
+ | rich_text_editor.insertString(" | ||
+ | rich_text_editor.insertHTML("< | ||
+ | rich_text_editor.insertLineBreak(); | ||
+ | rich_text_editor.deleteInDirection(" | ||
+ | rich_text_editor.activateAttribute(" | ||
+ | rich_text_editor.deactivateAttribute(" | ||
+ | </ | ||
+ | |||
+ | Please see https:// |