imported>Aeric |
imported>Aeric Β |
(54 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| These Javascript functions are available for use in a JSP/HTML [[Page]] in the platform. They can also be used in Javascript defined for [[Action]] buttons.
| | #REDIRECT [[JavaScript Functions]] |
| __TOC__
| |
| ===lj_showDialog===
| |
| Β | |
| ===printDocument===
| |
| This function displays a customized print dialog for a record. Use it to set defaults, to limit the available choices, and to choose the [[Print Template]] which is used.
| |
| Β | |
| ;Syntax:
| |
| :<syntaxhighlight lang="javascript" enclose="div">
| |
| javascript:printDocument('{option1}={value}&{option2}={value}&...');
| |
| </syntaxhighlight>
| |
| Β | |
| ;Sample Usage:
| |
| This code adds a '''[customPrint]''' button to a page.
| |
| :<syntaxhighlight lang="javascript" enclose="div">
| |
| $("#edit_button").parent().append("<input type='button' id='customPrint' value='Custom Print' class='lj-button fg-button ui-state-default ui-corner-all' onClick=\"javascript:printDocument('default_print_layout=template&show_print_layout=no&default_print_document=jsp&default_page_orientation=landscape&default_pdf=yes&show_pdf=no&print_immediately=yes');\">");
| |
| </syntaxhighlight>
| |
| Β | |
| ;Parameters:
| |
| Each option has two parameters: One to specify a default value, the other to determine whether it should be displayed so it can be overridden by the user.
| |
| Β | |
| By default, an option is always shown, unless explicitly hidden.
| |
| Β | |
| :{|
| |
| ! Parameter !! Description (default value in '''bold''')
| |
| |-
| |
| | default_print_document || Object '''form''' or JSP/HTML [Page]
| |
| |-
| |
| | show_print_document || '''yes'''
| |
| |-
| |
| | default_print_layout || The form layout or template page to use.
| |
| |-
| |
| | show_print_layout || '''yes'''
| |
| |-
| |
| | default_page_orientation || '''portrait''' or landscape
| |
| |-
| |
| | show_page_orientation || '''yes'''
| |
| |-
| |
| | default_pdf || '''yes''' (otherwise, an HTML page is generated)
| |
| |-
| |
| | show_pdf || '''yes'''
| |
| |-
| |
| | print_immediately || '''no''' (queued, instead)
| |
| |-
| |
| | show_print_immediately || '''yes'''Β
| |
| |}
| |