- Sencha Touch - Best Practice
- Sencha Touch - Packaging
- Sencha Touch - View Components
- Sencha Touch - Upload & Download
- Sencha Touch - History & Support
- Sencha Touch - Layout
- Sencha Touch - Events
- Environment Detection
- Sencha Touch - Dependencies
- Sencha Touch - Device Profile
- Sencha Touch - Theme
- Sencha Touch - Data
- Sencha Touch - Core Concepts
- Sencha Touch - Migration Steps
- Sencha Touch - Build Application
- Sencha Touch - First App
- Sencha Touch - MVC Explanation
- Sencha Touch - Architecture
- Sencha Touch - Naming Convention
- Sencha Touch - Environment
- Sencha Touch - Overview
- Sencha Touch - Home
Sencha Touch Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Sencha Touch - Best Practice
Basic JavaScript best practice
It is a good practice to keep all JavaScript-related code in a separate js (external JS) file, instead of writing it in the <script> tag under the head section or inpne JavaScript in the document body.
Always perform a null check before the element is being used in further logic.
Always follow the naming convention, as it makes the code easy to understand by any other programmer.
To make the code easily understandable, it is always preferred to write comments for JS methods with clear logic behind what a function does.
Best practice specific to Sencha Touch
Use Sencha Touch recommended folder structure, which will be helpful during JS compression or minification.
It is highly recommended to use the pstener (oncpck/onblur, etc.) in the controller instead of writing it in the html page itself.
Do not create the store instance, when the store is being called from the view.
When we create an instance of a store, we should always destroy it, as it impacts the performance.
While using Sencha Touch, do not specify any other simple JavaScript file. Use all the functions from Ext classes (mentioned in controller or utils).
When the model mapping and the name are same, then do not specify mapping. Only name will solve the purpose.
Do not use unnecessary properties in view. Use only the property which is required and it value which is different from the default value.
Advertisements