Suds: A JavaScript SOAP Client Librar

Suds: A JavaScript SOAP Client Library

XML is like violence – if it doesn’t solve your problem, you’re probably not using enough of it.

Suds is a lightweight SOAP client library for JavaScript. Suds has been tested on the following platforms:

Titanium Desktop (0.7.0)

Titanium Mobile (0.7.1)

via kwhinnery/Suds – GitHub.

xmlObjectifier – interesting library for converting XML or SOAP to JSON

Looking for a simple way to convert XML to JSON Object?

xmlObjectifier is designed to assist coders working with XML data to quickly and painlessly process XML documents using familiar to JavaScript developpers methods. This useful code will provide  transparent obstraction layer to those applications that utilize both JSON and XML data, it also allows you to cache your data for later use. xmlObjectifier is written in client-side JavaScript to reduce processing overhead and to provide optimal compatibility across various browsers.

via.

Cross-domain Ajax requests – Sencha Touch Bits

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

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.

YUI 3 — Yahoo! User Interface Library

YUI 3 — Yahoo! User Interface Library

YUI 3 is Yahoo!’s next-generation JavaScript and CSS library. It powers the new Yahoo! homepage, Yahoo! Mail, and many other Yahoo! sites. The YUI 3 Library has been redesigned and rewritten from the ground up incorporating what we’ve learned in five years of dedicated library development. The library includes the core components, a full suite of utilities, the Widget Infrastructure, a growing collection of widgets, CSS resources, and tools. All YUI components are BSD-licensed and are available for forking and contribution on GitHub. In addition to the core components included in the YUI 3 Library, there is also a gallery of components created by developers in the YUI community that provide additional functionality leveraging YUI 3 that can be used in the development of robust web applications.

via YUI 3 — Yahoo! User Interface Library.

ExtJS remote grid filtering with ColdFusion

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...
});

Designing with Progressive Enhancement: Building the web that works for everyone. By Filament Group: Todd Parker, Patty Toland, Scott Jehl, Maggie Costello Wachs

Every web developer should have this book!

via Designing with Progressive Enhancement: Building the web that works for everyone. By Filament Group: Todd Parker, Patty Toland, Scott Jehl, Maggie Costello Wachs.