Create Mobile Friendly Custom Views
Overview
This article introduces how to create Custom Views on Kintone that are mobile-friendly.
Sample Image
When users navigate to the Custom View, they are able to view a list of links. These contents can be viewed via the desktop browser, and can also be viewed through the mobile browser or mobile App.
If customizations are only applied to the desktop view, the list of links on the Custom View are not displayed on the mobile.
Prepare the App
Create the Form
Create an App with the following field and settings. Save the form when finished.
Field Type | Field Name | Field Code | Notes |
---|---|---|---|
Text | Title | title | Holds the title of the link. |
Link | URL | url | Type set as URL. Holds the link URLs. |
Create the Custom View
Navigate to the Views tab and create a new View . Give the view a name and select Custom view. Select the Both Desktop and Mobile-optimized views option, so that Custom Views will be available for mobile devices. Enter the following HTML in the HTML Code option.
|
|
The Custom View settings should look like the following image.
Sample Code
Desktop Customizations
Prepare the following JavaScript and CSS codes in separate text editors and navigate to the Kintone App's settings. Upload the files into the Upload JavaScript for PC and Upload CSS File for PC options of the JavaScript and CSS Customization settings .
Desktop version JavaScript (desktop.js)
|
|
Desktop version CSS (desktop.css)
|
|
Mobile Customizations
Prepare the following JavaScript and CSS codes in separate text editors and navigate to the Kintone App's settings. Upload the files into the Upload JavaScript for Mobile Devices and Upload CSS File for Mobile Devices options of the JavaScript and CSS Customization settings .
Mobile version JavaScript (mobile.js)
|
|
Mobile version CSS (mobile.css)
|
|
Notes on uploading the files
In the App settings, JavaScript and CSS files for desktop and mobile are separated so that customizations may be applied to only one or the other. Therefore, the JavaScript and CSS files prepared earlier need to be uploaded to their appropriate locations.
The JavaScript and CSS Customization Settings should look like the below image.
Test the Customization
Once the changes have been applied to the App, navigate to the Custom View through the Desktop Browser. The Custom View should display a list of links. Next, access the Custom View through the mobile App of Kintone. The Custom View should again display a list of links.