Archive for the ‘ExtJS’ Category

Cross-domain Ajax requests – Sencha Touch Bits

August 18, 2011

Cross-domain Ajax requests

MARCH 11, 2011

Before you get any hopes (or worries), the following is just a technique that comes handy for development, not for production.

I’m developing a PhoneGap app with Sencha Touch. The app needs to do a few Ajax POST requests to a different domain. You can do that without problems from your PhoneGap app.

Though, the development environment of choice for a Sencha Touch developer is the browser. Browsers don’t let you do that, at least not by default. (You can do cross-domain GET requests easily via JSONP.)

By default, the browser, WebKit in this case, returns the following error: XMLHttpRequest cannot load URL. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

Though, you can easily disable that security policy by opening the browser with –disable-web-security.

So, if you’re using Google Chrome on a Mac for development, run the following in the Terminal:

open /Applications/Google\ Chrome.app –args –disable-web-security

via Cross-domain Ajax requests – Sencha Touch Bits.

Countdown to Ext JS 4: Anatomy of a Model | Blog | Sencha

March 5, 2011

Countdown to Ext JS 4: Anatomy of a ModelFebruary 08, 2011 | Ed Spencer If you follow Ext JS, chances are you already know that we have a brand new data package for Ext JS 4. The new data package builds on the principles of the one in Ext JS 3 while adding a huge number of new capabilities. We recently introduced the new data package on our blog, and today we’re going to take a deeper look at the new Model class.A Model represents almost any type of persistable data in an application. For example, an e-commerce application might have models for User, Product, Order and so on. Each model contains a set of fields as well as functions that enable the application to operate on its data—for example an Order model might have a ‘shipToCustomer’ function that kicks off the shipping process.Ext JS 3.x and before had a class called Record, which was very similar to the new Model class. The difference is that whereas Record was only fields and functions, Model is much more powerful. Today, we’re going to look at four of the principal parts of Model—Fields, Proxies, Associations and Validations.

via Countdown to Ext JS 4: Anatomy of a Model | Blog | Sencha.

ExtJS remote grid filtering with ColdFusion

January 12, 2011

Ran into a challenge today trying to get remote grid filtering to work with an ExtJS/Sencha grid (v3.2.2). Problem was that the GridFilter.js plugin formats column filters set by the user based on an array of javascript objects in a format that PHP likes when consuming form variables, but ColdFusion would throw errors. The default format of the variables looks the following:

filter[0][data][type]
filter[0][data][value]
filter[0][field]

The solution was to override the buildQuery function in the GridFilters.js plugin in my filter setup block on the page in question. This results in nicely formatted form variables like the following:

filter_0_data_type
filter_0_data_value
filter_0_field

Here’s the code with the override function defined:

var filters = new Ext.ux.grid.GridFilters({
    // encode and local configuration options defined previously for easier reuse
    encode: encode, // json encode the filter query
    local: false,   // defaults to false (remote filtering)
    buildQuery: function(filters) {
        // override to standard form variable formatting
        var p = {},
        i,
        f,
        root,
        dataPrefix,
        key,
        tmp,
        len = filters.length;

        if (!this.encode) {
            for (i = 0; i & lt; len; i++) {
                f = filters[i];
                root = [this.paramPrefix, '_', i].join('');
                p[root + '_field'] = f.field;
                dataPrefix = root + '_data';
                for (key in f.data) {
                    p[[dataPrefix, '_', key].join('')] = f.data[key];
                }
            }
        } else {
            tmp = [];
            for (i = 0; i 0) {
                p[this.paramPrefix] = Ext.util.JSON.encode(tmp);
            }
        }
        return p;
    },
    filters: [{
        type: 'numeric',
        dataIndex: 'id'
    },
    {
        type: 'string',
        dataIndex: 'customerItemNumber',
        disabled: false
    }]
    // additional filter columns removed for brevity...
});

apex extjs integration

January 12, 2011

apex extjs integration.

Nice blog with insights on ExtJs (grid in particular) for those not using PHP on the backend.

Raymond Camden’s ColdFusion Blog: Using argumentCollection with AJAX calls to ColdFusion Components

November 2, 2010

If you pass argumentCollection=data to a CFC method (or any UDF), then ColdFusion acts as if you had passed arguments name, age, and coolness. As I said above, this isn’t new at all, but I’ve never seen it used with an AJAX post like this. What’s nice then is that on the server side, you can have a “proper” method without any if/else statement to see if the result was JSON. As a quick example, here is an updated version of the front end code based on the previous example. I went ahead and added jquery-json to the template to further simplify things.

via Raymond Camden’s ColdFusion Blog: Using argumentCollection with AJAX calls to ColdFusion Components.

Awesome tip and as usual a complete and yet concise example of how to use it.

Ext – Ext Designer Ships

March 31, 2010

Ext – Ext Designer.  Even if you don’t like to take your hands off the keyboard this tool will have a place in prototyping and design and provides an example of the kinds of things that possible in javascript.

Ext JS releases V3.1 – TreeGrid widget, AIR and memory optimization

December 19, 2009

This looks to be an excellent upgrade specifically addressing IE memory management and enhancing the split into core and UI.

Get it NOW!

Ext JS – Blog.

CFINNC Update

October 28, 2009

The conference in Raleigh was really excellent with attendance of around 250.

Sessions that I got the most out included two on ORM by Bob Silverberg that got down to code samples of what is great about the ORM approach to database access and management. TIP – no need for cfQueryParam with ORM any more – woot! See Bob’s basepersistentobject.riaforge.com for something to get started, and read the Adobe help on this first as it is very good.

Building RIAs using Ext JS 3.0 and ColdFusion was very informative as Paul Cormier has been using the ExtJS and CF together for a while.

Sean Corfield also delivered an impassioned overview of the ColdFusion open source landscape and threw down the gauntlet to CF developers to give back. I will see what I can do!

Oh, also liked Andy Matthews session on CF and AIR with jQuery. AIR apps rock. Check out the AIR Introspector – like firebug for AIR apps – air.introspector.console.log to invoke it.

Did two sessions on the CFBuilder IDE including Charlie Arehart’s Hidden Gems in CFBuilder and Simon Free’s CFBuilder Basics. I will definitely be using CFB for the productivity enhancements and tight integration with CF.

Finally, Excel and Coldfusion delivered by Jim Wright compared advanced Excel file creation and manipulation pre CF9 and compared it to what is new with CF9 new features. See http://www.bennadel.com/projects/poi-utility.htm for information on the POIUtility.cfc by Ben Nadel for more information. POI not good only at a luau!

Leaving in the morning for CFINNC!

October 15, 2009

Need more AIR, ORM, and ExtJS with CF!


Follow

Get every new post delivered to your Inbox.

Join 178 other followers