jigr69, the code is working in 2.2.4 without a problem. Here is my exact code and how I am using it. Give it a try and let me know how you make out.
I created a snippet called "getResourceList" with the following code:
<?php
$parent = isset($parent) ? $parent : $modx->resource->get('id');
$depth= isset($depth) ? $depth : '10';
$sortby = isset($sortby) ? $sortby : 'pagetitle';
$childs = $modx->getChildIds($parent,$depth,array('context' => 'web'));
$c = $modx->newQuery('modResource');
$c->where(array('published'=>1,'deleted:!=' =>'1'));
$c->where(array('id:IN'=>$childs));
$c->sortby($sortby);
$collection = $modx->getCollection('modResource',$c);
$output='-==';
foreach ($collection as $o){
$output .= '||'.$o->get('pagetitle').'('.$o->get('id').')=='.$o->get('id');
}
return $output;
Then in my TV I used the following code as Input Option Values on the input tab:
@EVAL return $modx->runSnippet("getResourceList", array('id'='3','depth'=>'2'));
If you wanted to pull children in of the current item then you would leave off the id value in the array:
@EVAL return $modx->runSnippet("getResourceList", array('depth'=>'2'));
I have been having great results using this with the Listbox Input Type and enabling Enable "Type-Ahead".