File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,11 @@ export default class SPTermStorePickerService {
159
159
let terms = termStoreResultTerms [ 0 ] . _Child_Items_ ;
160
160
// Clean the term ID and specify the path depth
161
161
terms = terms . map ( term => {
162
- term . CustomSortOrderIndex = ( termStoreResultTermSet . CustomSortOrder ) ? termStoreResultTermSet . CustomSortOrder . split ( ":" ) . indexOf ( this . cleanGuid ( term . Id ) ) : - 1 ;
162
+ if ( term . IsRoot ) {
163
+ term . CustomSortOrderIndex = ( termStoreResultTermSet . CustomSortOrder ) ? termStoreResultTermSet . CustomSortOrder . split ( ":" ) . indexOf ( this . cleanGuid ( term . Id ) ) : - 1 ;
164
+ } else {
165
+ term . CustomSortOrderIndex = ( term [ "Parent" ] . CustomSortOrder ) ? term [ "Parent" ] . CustomSortOrder . split ( ":" ) . indexOf ( this . cleanGuid ( term . Id ) ) : - 1 ;
166
+ }
163
167
term . Id = this . cleanGuid ( term . Id ) ;
164
168
term [ 'PathDepth' ] = term . PathOfTerm . split ( ';' ) . length ;
165
169
term . TermSet = { Id : this . cleanGuid ( termStoreResultTermSet . Id ) , Name : termStoreResultTermSet . Name } ;
You can’t perform that action at this time.
0 commit comments