ผลต่างระหว่างรุ่นของ "CuneiModal"

จาก คูนิฟ็อกซ์ วิกิ
บรรทัดที่ 25: บรรทัดที่ 25:
'''<syntaxhighlight lang="javascript">
'''<syntaxhighlight lang="javascript">
modal_lower_half(modalid, class="success", head_bg=false, hidden=false,
modal_lower_half(modalid, class="success", head_bg=false, hidden=false,
ok_btn=gettext("OK"), hide_ok=false, addi_btns=[],
ok_btn="OK", hide_ok=false, addi_btns=[],
close_btn=gettext("Close"), hide_cancel=false)
close_btn="Close", hide_cancel=false)
</syntaxhighlight>'''
</syntaxhighlight>'''


บรรทัดที่ 35: บรรทัดที่ 35:
* '''class''' and '''head_bg''' take the formats of ''class'' and ''custom_color'' arguments of CuneiForm's '''[[CuneiForm#Buttons & Submits|render_btn]]''' respectively. They dictates the colour of the table header as well as the color scheme of the full-form modal (when applicable). Note that, if both are given, '''head_bg''' takes precedence.
* '''class''' and '''head_bg''' take the formats of ''class'' and ''custom_color'' arguments of CuneiForm's '''[[CuneiForm#Buttons & Submits|render_btn]]''' respectively. They dictates the colour of the table header as well as the color scheme of the full-form modal (when applicable). Note that, if both are given, '''head_bg''' takes precedence.
* '''hidden''' ''(bool)'':
* '''hidden''' ''(bool)'':
* '''ok_btn''' ''(bool)'':
* '''ok_btn''' ''(str)'':
* '''hide_ok''' ''(bool)'':
* '''hide_ok''' ''(bool)'':
* '''addi_btns''' ''(bool)'':
* '''addi_btns''' ''(array)'':
* '''close_btn''' ''(bool)'':
* '''close_btn''' ''(str)'':
* '''hide_cancel''' ''(bool)'':
* '''hide_cancel''' ''(bool)'':
|}
|}

รุ่นแก้ไขเมื่อ 12:29, 20 มิถุนายน 2567

CuneiModals are basically pop-up windows with pre-defined scripts and event handlers to make them work fluently with CuneiForms and CuneiTables. They are purely client-side constructs, so there are no needs to define and initiate them on the server side. It is, however, necessary for the server-side developer to anticipate their existence and, in most cases, their IDs in the server-side code. (See attributes in_modal of CuneiForms and in_modal/bound_modal of CuneiTables.)

Design & Pre-made Scripts

Modal Upper Macro & Modal Object

modal_upper_half(modalid, type="table", title="Look up", 
				 class="primary", head_bg=false, size=false,
				 first_focus=false)
Parameters DO NOT rely on argument order farther than modalid and type, ALWAYS PROVIDE argument keywords.
  • modalid (str)
  • type (str):
  • title (str):
  • class and head_bg take the formats of class and custom_color arguments of CuneiForm's render_btn respectively. They dictates the colour of the table header as well as the color scheme of the full-form modal (when applicable). Note that, if both are given, head_bg takes precedence.
  • size (str):
  • first_focus (str):

Modal Lower Macro

modal_lower_half(modalid, class="success", head_bg=false, hidden=false,
				 ok_btn="OK", hide_ok=false, addi_btns=[],
				 close_btn="Close", hide_cancel=false)
Parameters DO NOT rely on argument order farther than modalid and type, ALWAYS PROVIDE argument keywords.
  • modalid (str)
  • class and head_bg take the formats of class and custom_color arguments of CuneiForm's render_btn respectively. They dictates the colour of the table header as well as the color scheme of the full-form modal (when applicable). Note that, if both are given, head_bg takes precedence.
  • hidden (bool):
  • ok_btn (str):
  • hide_ok (bool):
  • addi_btns (array):
  • close_btn (str):
  • hide_cancel (bool):

Notable Sub-routines

Modal Showing

Modal Hiding