code: function (a, b) {
              if (!a.name || !b.name) {
                  return 0;
              }
              var an = a.name.toLowerCase(),
                  bn = b.name.toLowerCase(),
                  ret = 0;
  
              if (an < bn) {
                  ret = -1;
              }
              if (an > bn) {
                  ret = 1;
              }
              return ret;
          }
docs: Sort method of array of objects with a property called __name__
  @method nameSort
  @param {Object} a First object to compare
  @param {Object} b Second object to compare
  @return {Number} 1, -1 or 0 for sorting.