NLiu's Table of Contents(TOC)/Map Service nested within another

Discussion created by huhao.esri on Nov 14, 2013
Latest reply on Nov 19, 2013 by huhao.esri
I have been using the TOC provided by nliu,

It's a really nice feature. I noticed that the layer hierarchy is based on Map Service on REST service. But in case that I have two map services from different resources that one of them is belonged to another. In other words, I do not want the two map services on the same level of hierarchy. For example, in the attached figure, I want all the layers in DynamicMapServiceLayer2 under DynamicMapServiceLayer 1 group. Can I implement this when rendering TOC?

A further explanation,
I want the layers and symbology of DynamicMapServiceLayer2 to be consumed under/blended with the DynamicMapServiceLayer 1 groups so that I have a single TOC categorized with group layers  -- and those groups include a variety of rest sources - local and remote.

Does anyone have the similar issue before?