This Week in Sencha (July 5, 2013)

This week’s assortment of Sencha-themed links from my @pdehaan Twitter feed from the past week:

This Week in Sencha (June 28, 2013)

This week’s assortment of Sencha-themed links from my @pdehaan Twitter feed from the past week:

To see what other @Sencha employees are tweeting, be sure to check out my unofficial Sencha Employee Twitter list.


Tickets are still available for #SenchaCon 2013, although you’ll want to register soon before prices go up! If you’re coming to Orlando a day early for SenchaCon, check out one of the great FREE bootcamps for Windows Azure, Tizen, or Sencha Touch on BlackBerry 10!

There will also be:

This is guaranteed to be the *BEST* Sencha conference happening in the next 12 months!

This Week in Sencha (June 21, 2013)

In case you missed it… Here’s a collection of Sencha-themed links from my @pdehaan Twitter feed from the past week+:

Also, if you haven’t registered for #SenchaCon 2013 yet, check out the new Session grid page and check out the great list of sessions and speakers.

To see what other @Sencha employees are tweeting, be sure to check out my unofficial Sencha Employee Twitter list.

Validating a project’s JavaScript code using Grunt and JSHint

If you haven’t used it before, Grunt is a task-based command line build tool for JavaScript projects, similar to Ant.

Grunt is built on top of Node.js and can be installed using npm (see Installing grunt and Introducing Grunt for more details).

Once installed, linting a JavaScript project is very easy. Simply create a grunt.js file in your project’s root directory and paste the following code:

#!/usr/bin/env node

module.exports = function (grunt) {
    "use strict";

    // Project configuration.
    grunt.initConfig({
        lint: {
            all: ["grunt.js", "**/*.js"]
        },
        jshint: {
            options: {
                browser: true,
                curly: true,
                eqeqeq: true,
                newcap: true,
                undef: true,
                eqnull: true,
                node: true
            },
            globals: {
                exports: true,
                Ext: false,
                console: false,
                alert: false,
                prompt: false
            }
        }
    });

    // Default task.
    grunt.registerTask('default', 'lint');
};

Then, simply open a Terminal window in your application’s root folder (where you saved the grunt.js file earlier), type `grunt` and each of your *.js files will be linted using the specified JSHint options:

$ grunt
path.existsSync is now called `fs.existsSync`.
Running "lint:all" (lint) task
Lint free.

Done, without errors.

Validating that an Ext.data.Model field contains an approved value in Sencha Touch 2

The following example shows how you can validate that an Ext.data.Model object’s value is in an acceptable value in Sencha Touch 2 by setting the validations object on the model and then creating an ‘inclusion’ validation with a list attribute of approved values.

Continue reading