// position in the path.
cols.expandPath = function(colSpec) {
- var dotpath = colSpec.path.replace(/\.\*$/,'');
+ var dotpath = colSpec.path.replace(/\.?\*$/,'');
var class_obj;
if (colSpec.parentIdlClass) {
// find the IDL class definition for the last element in the
// path before the .*
- var class_obj;
- for (var path_idx in path_parts) {
- var part = path_parts[path_idx];
- var idl_field = class_obj.field_map[part];
-
- // unless we're at the end of the list, this field should
- // link to another class.
- if (idl_field && idl_field['class'] && (
- idl_field.datatype == 'link' ||
- idl_field.datatype == 'org_unit')) {
- class_obj = egCore.idl.classes[idl_field['class']];
- } else {
- if (path_idx < (path_parts.length - 1)) {
- // we ran out of classes to hop through before
- // we ran out of path components
- console.error("egGrid: invalid IDL path: " + path);
+ // an empty path_parts means expand the root class
+ if (path_parts) {
+ for (var path_idx in path_parts) {
+ var part = path_parts[path_idx];
+ var idl_field = class_obj.field_map[part];
+
+ // unless we're at the end of the list, this field should
+ // link to another class.
+ if (idl_field && idl_field['class'] && (
+ idl_field.datatype == 'link' ||
+ idl_field.datatype == 'org_unit')) {
+ class_obj = egCore.idl.classes[idl_field['class']];
+ } else {
+ if (path_idx < (path_parts.length - 1)) {
+ // we ran out of classes to hop through before
+ // we ran out of path components
+ console.error("egGrid: invalid IDL path: " + dotpath);
+ }
}
}
}
var column = fromExpand ? colSpec : cols.cloneFromScope(colSpec);
- if (column.path && column.path.match(/\*/))
+ if (column.path && column.path.match(/\*$/))
return cols.expandPath(colSpec);
if (!column.name) column.name = column.path;