docs: function sortByName(child1, child2) {
              var ret = checkStatesFirst(child1, child2);
              if (ret) return ret;
  
              var o1 = objects[child1.key], o2 = objects[child2.key];
              if (o1 && o2) {
                  var c1 = o1.common, c2 = o2.common;
                  if (c1 && c2) {
  
                      // var s1 = child1.key.substr(0, child1.key.lastIndexOf('.')); // faster than regexp.
                      // var s2 = child2.key.substr(0, child2.key.lastIndexOf('.'));
                      // if (s1 > s2) return 1;
                      // if (s1 < s2) return -1;
  
                      if (!data.sortConfig.ignoreSortOrder && c1.sortOrder && c2.sortOrder) {
                          if (c1.sortOrder > c2.sortOrder) return 1;
                          if (c1.sortOrder < c2.sortOrder) return -1;
                          return 0;
                      }
                      var name1;
                      var name2;
                      if (c1.name) {
                          name1 = c1.name;
                          if (typeof name1 === 'object') {
                              name1 = (name1[systemLang] || name1.en).toLowerCase();
                          } else {
                              name1 = name1.toLowerCase();
                          }
                      } else {
                          name1 = child1.key;
                      }
                      if (c2.name) {
                          name2 = c2.name;
                          if (typeof name2 === 'object') {
                              name2 = (name2[systemLang] || name2.en).toLowerCase();
                          } else {
                              name2 = name2.toLowerCase();
                          }
                      } else {
                          name2 = child1.key;
                      }
                      if (name1 > name2) return 1;
                      if (name1 < name2) return -1;
                  }
              }
              if (child1.key > child2.key) return 1;
              if (child1.key < child2.key) return -1;
              return 0;
          }