protected virtual void RegisterJavaScript()
{
string treeViewScriptFormat =
@"Rock.controls.itemPicker.initialize({{
controlId: '{0}',
restUrl: '{1}',
allowMultiSelect: {2},
defaultText: '{3}',
restParams: $('#{4}').val(),
expandedIds: [{5}]
}});
";
string treeViewScript = string.Format( treeViewScriptFormat, this.ClientID, this.ResolveUrl( ItemRestUrl ), this.AllowMultiSelect.ToString().ToLower(), this.DefaultText, _hfItemRestUrlExtraParams.ClientID, this.InitialItemParentIds );
ScriptManager.RegisterStartupScript( this, this.GetType(), "item_picker-treeviewscript_" + this.ClientID, treeViewScript, true );
}