Skip to content

Instantly share code, notes, and snippets.

View JohanVandeplas's full-sized avatar

Johan Vandeplas JohanVandeplas

View GitHub Profile
@JohanVandeplas
JohanVandeplas / override.data.proxy.Server.js
Created September 11, 2012 09:22
fix mapping for sorting (+ extra sorting param for special sorter mapping) Works for normal and simpleSortMode
Ext.override(Ext.data.proxy.Server, {
encodeSorters: function (sorters, string) {
var model = this.model,
map = model.prototype.fields.map,
encSort = Ext.Array.map(sorters, function (sorter) {
return {
property : map[sorter.property].sorting || map[sorter.property].mapping || sorter.property,
direction: sorter.direction
};
});
{
"message": "",
"total": 1,
"success": true,
"rows": [
{
"lab_visit_id": "22",
"upddate": "02 Feb 2012 14:25:33",
"lab_id": "22",
"visit_date": "16 Nov 2009",
@JohanVandeplas
JohanVandeplas / ST 2.0.0.js
Created March 11, 2012 16:53
Snippet from the Sencha Touch 2.0 framework
/**
* @class Ext.data.NodeInterface
* This class is meant to be used as a set of methods that are applied to the prototype of a
* Record to decorate it with a Node API. This means that models used in conjunction with a tree
* will have all of the tree related methods available on the model. In general this class will
* not be used directly by the developer. This class also creates extra fields on the model if
* they do not exist, to help maintain the tree state and UI. These fields are:
* <ul>
* <li>parentId</li>
* <li>index</li>