See our YouTube channel for introductory tutorials
The Knack Toolkit Library (KTL) is an open-source collection of JavaScript utilities designed to streamline Knack application development by adding advanced features that are difficult to implement. Its primary purpose is to accelerate the development of complex features and provide solutions to shortcomings in Knack, enabling high-level functionalities with minimum effort and technical knowledge.
- User-Friendly: No coding skills required. Utilize a simple keyword-based approach within the Builder to activate desired features and behaviors.
- Developer-Friendly: Provides a plethora of useful functions, from general utilities to in-depth access to Knack's internal structure, catering to both beginners and advanced users.
- Simplifies complex tasks in Knack applications.
- Enhances development efficiency with pre-built functions.
- Flexible for both non-coders and experienced developers.
For the few features that require API calls, everything is done to minimize their usage as much as possible. All calls are 100% view-based, so your API key is never used.
Need a quick intro? YouTube channel for introductory tutorials
KTL uses reserved keywords to trigger features. You decide if and where you need them. All keywords are created in the Builder and are never visible in the app. All keywords must start with an underscore followed by a letter.
A few examples:
_ts (to show a timestamp)
_ar=30 (to auto-refresh a view every 30 seconds)
_cfv=Deals,has,On Sale,red,yellow (to colorize a field in red text on yellow background when a value contains “On Sale”)
Keywords can be used in two places: in fields and views.
Keywords can be added in a field’s description, in the table view.
When used in a field, the keyword will be applied across the board in your app, in all views using this field.
Keywords can be added in a view’s title or description - interchangeably or together. Each keywords are separated by a space, or line feeds (return) when used in the description box. In some cases, it can also be used inside a Rich Text.
When used in a view, the keyword will be applied in that view only.
In some cases, the keyword placed in a view will apply to the whole app, like the _loh (Log Out Here) keyword. These are app-wide keywords and will be clearly identified.
Also, to make them more readable in the Builder, you can add <br>
in front of each, to force them to spread over separate lines. They must be at the beginning and in direct contact with the keyword's underscore.
Example:
_ar=60
<br>_ts
<br>_ha
For views, all keywords must be placed after the last word that you intend to keep visible. All text beyond the first keyword found will be truncated (invisible) in the app.
For fields, it is not relevant since descriptions are “internal notes” for developers only and not visible in the app anyways.
Some keywords require one or more parameters, and some may be optional. When using parameters, the equal sign “=”operator is added after the keyword, followed by the parameter(s). If multiple parameters are used, the comma is the separator and spaces are allowed.
Ex: _rvs=vTitle1, vTitle2
The keywords are not case-sensitive, but the parameters are and must always be an exact match to take effect.
Some keywords can accept many groups of parameters in a chain. In those cases, the groups are enclosed in square brackets.
Example with two groups: _cfv=[Column1,neq,,,red,,iu], [Column2,gte,100, yellow,#00F9]
Need a quick intro? YouTube channel for introductory tutorials
If you want to try/use the basic default setup version of the KTL, all you need to do is copy the 5 lines of code from this file KTL_Loader.js at the top of the Javascript pane of the Builder. See the next section for the list of basic features.
If you already have your own code, it will not conflict with the KTL. Just leave it after those added lines.
If you do not like some features, you can turn them off or customize them individually – see here.
Zero config needed for Basic Features
Right out of the box, without any coding or complex setup, the KTL will provide these nice additions to your app:
- Using reserved keywords to trigger special behavior. See list.
- User filters to save your filters to named buttons
- Bulk Operations: Edit, Copy, Delete and Action
- Form data persistence that saves as you type, and will load back your data if a page is reloaded after a submit failure or power outage
- Dropdown selector improvements
- Click followed by long press anywhere in a view to refresh that view (Click + ClickHold)
- Numeric pre-validation
- Auto-focus on first field of a form or search field in a table
- Sorted menus
- Show page’s title in browser’s tab
- Go to Date selector added to all calendar views
- Better keyboard support: Enter to Submit, image viewer left/right arrows for next/prev, and esc to exit
- Custom highlight/color for table’s inline-editable fields for easy identification
- Custom highlight/color for table row hover
- Ctrl+Click on a table’s header to invert the default sort
- Idle (inactivity) timeout watchdog
- Spinner timeout watchdog
- Kiosk mode support
- Debug window for embedded devices
The KTL “keyword-based” approach is an ideal tool for non-coders. But behind each of those keywords lies a huge collection of “hidden” function waiting to be leveraged.
If ever you’re interested in some basic or advanced coding, click the following links to know more about Advanced Features and Advanced Development Modes.
- Direct front-end external data Import from an Excel or CSV file. We've done this successfully for Morbern Inc. the main sponsor of this project, and it works flawlessly.
- Use JSDoc to have an adequate auto-generated and detailed API documentation, for each function with parameter description, etc.
- Geofencing and other map-based features, with geo-based events and Google Maps integration.
- The sky's the limit! Let us see what we can come up with…
That's about it for now, thanks for reading this and testing the library. Hope you’ll enjoy it as much as we did creating it. Now, let’s see how many of you will collaborate on this project. Cortex R&D needs you!!!
Normand Defayette
Cortex R&D Inc.
Blainville, Québec, Canada