1,813
การแก้ไข
| บรรทัดที่ 560: | บรรทัดที่ 560: | ||
== Notable Features & Sub-routines == | == Notable Features & Sub-routines == | ||
This section aims to give a little insight into some CuneiForm's notable sub-routines. | |||
=== Table Tracking === | |||
The role of the table tracking form in this feature is only to pack the appropriate value into the attribute '''selection_trackers''' of the corresponding {{code|table_obj}}. The inner working of this function is all handled by [[CuneiTable]], refer to the main article for more details. | |||
=== Search and Fill === | === Search and Fill === | ||
Searching and filling sub-routine can be triggered in 3 ways listed below, with slightly different behaviours. These 3 trigger paths can be conflicting, thus the '''populating''' and '''search_filling''' flag attributes. | |||
# '''Click event''' on the adjacent search button [[ไฟล์:Cuneifox search btn.png|25px|frameless|alt=Search button|Search button]]. This trigger mode always launch the search modal with full selections. In this trigger path, CuneiForm commands the search modal to launch, then relinquishes control. The control is only handed back once a selection is made. | |||
# '''Pressing {{key press|Tab}} or {{key press|Enter}}''' to navigate away from the search field. This triggers the ''quick-search'' mode ''(see note)''. | |||
# '''Navigating away from the field by any other means''' (handled by ''change'' event on the field) also triggers the ''quick-search'' mode ''(see note)''. | |||
In ''quick-search'' mode, CuneiForm commands the search table (directly within the search modal) to send a modified data fetch request first, then relinquishes control. The modified CuneiTable fetch request has a special instruction to: | |||
* Fetch only entries whose search column value start with the field value. | |||
* If the fetch returns multiple entries, the search modal is launched by CuneiTable itself. | |||
* If the fetch returns only 1 entries, automatically make the selection and does not show the search modal at all. (The modal might appear if the server takes longer than 500ms to response, in that case, the modal will automatically close.) | |||
'''NOTE THAT''' trigger paths #2 and #3 only work if the field value is modified (detected via ''input'' events on the field) to prevent unnecessary requests. | |||
=== Instacalc Routine === | === Instacalc Routine === | ||
| บรรทัดที่ 569: | บรรทัดที่ 583: | ||
=== Navigation & Focusing === | === Navigation & Focusing === | ||
=== Form Submission === | |||
{{The Tenko Shrine}} | {{The Tenko Shrine}} | ||