fit-ui 2.17.2 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Fit.UI.css CHANGED
@@ -5066,6 +5066,12 @@ div.FitUiControlTreeView li ul li > span
5066
5066
  cursor: pointer;
5067
5067
  }
5068
5068
 
5069
+ div.FitUiControlTreeView[data-htmlallowed="true"] li ul li > span
5070
+ {
5071
+ display: inline-block;
5072
+ line-height: normal;
5073
+ }
5074
+
5069
5075
  /* Indent node title if checkboxes are enabled.
5070
5076
  Notice: Node title is ALWAYS indented if TreeView is in Multi Selection mode, to make sure node titles are always vertically aligned
5071
5077
  if some nodes have checkboxes, and some do not. It looks odd If all checkboxes are disabled, though, since it leaves a big gap.
package/dist/Fit.UI.js CHANGED
@@ -682,7 +682,7 @@ Fit._internal =
682
682
  {
683
683
  Core:
684
684
  {
685
- VersionInfo: { Major: 2, Minor: 17, Patch: 2 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
685
+ VersionInfo: { Major: 2, Minor: 18, Patch: 0 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
686
686
  }
687
687
  };
688
688
 
@@ -5370,7 +5370,10 @@ Fit.String.StripHtml = function(str)
5370
5370
  {
5371
5371
  Fit.Validation.ExpectString(str);
5372
5372
 
5373
- return str.replace(/(<([^>]+)>)/g, "");
5373
+ return str.replace(/<\/?[a-zA-Z][^>]*>/g, "");
5374
+
5375
+ // Disabled - a value such as "A < B > C" will have "< B >" removed which is not desirable
5376
+ //return str.replace(/(<([^>]+)>)/g, "");
5374
5377
 
5375
5378
  // Disabled - whitespaces are not preserved!
5376
5379
  /*var span = document.createElement("span");
@@ -17306,6 +17309,7 @@ Fit.Controls.DropDown = function(ctlId)
17306
17309
  var itemCollection = {}; // Indexed collection for selected items (for fast lookup)
17307
17310
  var itemCollectionOrdered = []; // Ordered item collection (item order can be changed using drag and drop)
17308
17311
  var itemDropZones = {}; // Indexed collection of dropzones used to enable item dragging/dropping
17312
+ var htmlAllowed = false; // Flag indicating whether HTML is allowed (shown) in selected items
17309
17313
  var placeholder = ""; // Placeholder value displayed when no selection is made
17310
17314
  var arrow = null; // Arrow button used to open/close drop down menu
17311
17315
  var txtPrimary = null; // Primary input (search) field initially available
@@ -17908,13 +17912,36 @@ Fit.Controls.DropDown = function(ctlId)
17908
17912
  Fit.Events.RemoveHandler(onScrollElement, onScrollEventId);
17909
17913
  }
17910
17914
 
17911
- me = itemContainer = itemCollection = itemDropZones = arrow = txtPrimary = txtActive = txtEnabled = dropDownMenu = picker = orgSelections = invalidMessage = invalidMessageChanged = initialFocus = maxHeight = prevValue = focusAssigned = closeHandlers = dropZone = isMobile = focusInputOnMobile = detectBoundaries = detectBoundariesRelToViewPort = persistView = highlightFirst = searchModeOnFocus = onScrollElement = onScrollEventId = cancelEventRegistrationOnOpen = onInputChangedHandlers = onPasteHandlers = onOpenHandlers = onCloseHandlers = suppressUpdateItemSelectionState = suppressOnItemSelectionChanged = clearTextSelectionOnInputChange = prevTextSelection = textSelectionCallback = cmdToggleTextMode = null;
17915
+ me = itemContainer = itemCollection = itemCollectionOrdered = itemDropZones = htmlAllowed = placeholder = arrow = txtPrimary = txtActive = txtEnabled = dropDownMenu = picker = orgSelections = invalidMessage = invalidMessageChanged = initialFocus = maxHeight = maxWidth = prevValue = focusAssigned = closeHandlers = dropZone = isMobile = focusInputOnMobile = detectBoundaries = detectBoundariesRelToViewPort = persistView = highlightFirst = searchModeOnFocus = onScrollElement = onScrollEventId = cancelEventRegistrationOnOpen = onInputChangedHandlers = onPasteHandlers = onOpenHandlers = onCloseHandlers = suppressUpdateItemSelectionState = suppressOnItemSelectionChanged = clearTextSelectionOnInputChange = prevTextSelection = textSelectionCallback = cmdToggleTextMode = null;
17912
17916
 
17913
17917
  base();
17914
17918
  });
17915
17919
 
17916
17920
  // Misc. options
17917
17921
 
17922
+ /// <function container="Fit.Controls.DropDown" name="HtmlAllowed" access="public" returns="boolean">
17923
+ /// <description> Get/set value indicating whether HTML is allowed (shown) in selected items </description>
17924
+ /// <param name="val" type="boolean" default="undefined"> If defined, True enables support for HTML, False disables it </param>
17925
+ /// </function>
17926
+ this.HtmlAllowed = function(val)
17927
+ {
17928
+ Fit.Validation.ExpectBoolean(val, true);
17929
+
17930
+ if (Fit.Validation.IsSet(val) === true && htmlAllowed !== val)
17931
+ {
17932
+ htmlAllowed = val;
17933
+
17934
+ // Update view - RenameSelection(..) will enable/disable HTML depending on htmlAllowed (set above)
17935
+
17936
+ Fit.Array.ForEach(itemCollectionOrdered, function(item)
17937
+ {
17938
+ me.RenameSelection(item.Value, item.Title);
17939
+ });
17940
+ }
17941
+
17942
+ return htmlAllowed;
17943
+ }
17944
+
17918
17945
  /// <function container="Fit.Controls.DropDown" name="Placeholder" access="public" returns="string">
17919
17946
  /// <description> Get/set value used as a placeholder on supported browsers, to indicate expected value or action </description>
17920
17947
  /// <param name="val" type="string" default="undefined"> If defined, value is set as placeholder </param>
@@ -18391,9 +18418,8 @@ Fit.Controls.DropDown = function(ctlId)
18391
18418
  }
18392
18419
 
18393
18420
  // Add title and delete button to title box
18394
- var titleWithoutHtml = Fit.String.StripHtml(title);
18395
- var textNode = document.createTextNode(titleWithoutHtml);
18396
- Fit.Dom.Add(item, textNode);
18421
+ var titleNode = me.HtmlAllowed() === false ? document.createTextNode(Fit.String.StripHtml(title)) : Fit.Dom.CreateElement(title);
18422
+ Fit.Dom.Add(item, titleNode);
18397
18423
  Fit.Dom.Add(item, cmdDelete);
18398
18424
 
18399
18425
  // Add elements to item container
@@ -18414,7 +18440,7 @@ Fit.Controls.DropDown = function(ctlId)
18414
18440
 
18415
18441
  itemContainer.insertBefore(container, before);
18416
18442
 
18417
- var itemObject = createItemObject(titleWithoutHtml, value, valid !== false, item, textNode); //convertItemElementToItemObject(item);
18443
+ var itemObject = createItemObject(title, value, valid !== false, item, titleNode); //convertItemElementToItemObject(item);
18418
18444
  itemCollection[itemObject.Value] = itemObject;
18419
18445
  itemCollectionOrdered.push(itemObject);
18420
18446
 
@@ -18578,14 +18604,19 @@ Fit.Controls.DropDown = function(ctlId)
18578
18604
 
18579
18605
  var selection = itemCollection[val] || null;
18580
18606
 
18581
- if (selection !== null && selection.Title !== newTitle)
18607
+ if (selection !== null)
18582
18608
  {
18583
- var titleWithoutHtml = Fit.String.StripHtml(newTitle);
18609
+ var orgTitle = selection.Title;
18610
+ var newTitleNode = me.HtmlAllowed() === false ? document.createTextNode(Fit.String.StripHtml(newTitle)) : Fit.Dom.CreateElement(newTitle);
18584
18611
 
18585
- Fit.Dom.Text(selection.TextNode, titleWithoutHtml);
18586
- selection.Title = titleWithoutHtml;
18612
+ Fit.Dom.Replace(selection.TitleNode, newTitleNode);
18613
+ selection.Title = newTitle;
18614
+ selection.TitleNode = newTitleNode;
18587
18615
 
18588
- fireOnChange();
18616
+ if (orgTitle !== newTitle)
18617
+ {
18618
+ fireOnChange();
18619
+ }
18589
18620
  }
18590
18621
  }
18591
18622
 
@@ -18788,7 +18819,7 @@ Fit.Controls.DropDown = function(ctlId)
18788
18819
 
18789
18820
  if (pickerItem !== null)
18790
18821
  {
18791
- updateSelectionElementTitleByValue(selected.Value, Fit.String.StripHtml(pickerItem.Title));
18822
+ me.RenameSelection(selected.Value, pickerItem.Title);
18792
18823
 
18793
18824
  Fit.Array.Add(updated, { Title: pickerItem.Title, Value: selected.Value, Exists: true });
18794
18825
  }
@@ -19536,15 +19567,15 @@ Fit.Controls.DropDown = function(ctlId)
19536
19567
  return txt;
19537
19568
  }
19538
19569
 
19539
- function createItemObject(title, value, valid, domElement, textNode)
19570
+ function createItemObject(title, value, valid, domElement, titleNode)
19540
19571
  {
19541
- Fit.Validation.ExpectString(title); // NOTICE: Title with any HTML stripped away!
19572
+ Fit.Validation.ExpectString(title);
19542
19573
  Fit.Validation.ExpectString(value);
19543
19574
  Fit.Validation.ExpectBoolean(valid);
19544
19575
  Fit.Validation.ExpectDomElement(domElement);
19545
- Fit.Validation.ExpectTextNode(textNode);
19576
+ Fit.Validation.ExpectNode(titleNode); // TextNode if HtmlAllowed() is false, DOMElement if HtmlAllowed() is true
19546
19577
 
19547
- return { Title: title, Value: value, Valid: valid, DomElement: domElement, TextNode: textNode };
19578
+ return { Title: title, Value: value, Valid: valid, DomElement: domElement, TitleNode: titleNode };
19548
19579
  }
19549
19580
  /*function convertItemElementToItemObject(itemElm)
19550
19581
  {
@@ -19552,20 +19583,6 @@ Fit.Controls.DropDown = function(ctlId)
19552
19583
  return { Title: Fit.Dom.Text(itemElm), Value: decode(Fit.Dom.Data(itemElm, "value")), Valid: Fit.Dom.HasClass(itemElm, "FitUiControlDropDownInvalid") === false, DomElement: itemElm };
19553
19584
  }*/
19554
19585
 
19555
- function updateSelectionElementTitleByValue(value, newTitle)
19556
- {
19557
- Fit.Validation.ExpectString(value);
19558
- Fit.Validation.ExpectString(newTitle); // NOTICE: Title with any HTML stripped away!
19559
-
19560
- var item = itemCollection[value] || null;
19561
-
19562
- if (item !== null)
19563
- {
19564
- item.Title = newTitle;
19565
- item.DomElement.childNodes[0].nodeValue = newTitle;
19566
- }
19567
- }
19568
-
19569
19586
  /*function getFirstSelectionElement()
19570
19587
  {
19571
19588
  if (itemCollectionOrdered.length > 0)
@@ -20205,7 +20222,7 @@ Fit.Controls.DropDown = function(ctlId)
20205
20222
 
20206
20223
  Fit.Array.ForEach(selections, function(selection)
20207
20224
  {
20208
- text += (text !== "" ? ", " : "") + selection.Title;
20225
+ text += (text !== "" ? ", " : "") + Fit.String.StripHtml(selection.Title); // Selected items might contain HTML if HtmlAllowed() is true
20209
20226
  });
20210
20227
 
20211
20228
  if (me.MultiSelectionMode() === true && selections.length > 0)
@@ -20925,6 +20942,7 @@ Fit.Controls.WSDropDown = function(ctlId)
20925
20942
  var useActionMenuForced = false;
20926
20943
  var useActionMenuAfterLoad = true;
20927
20944
  var useActionMenuSortingLocale = null;
20945
+ var useActionMenuHtmlAllowed = false;
20928
20946
  var treeViewEnabled = true;
20929
20947
  var orgPlaceholder = this.Placeholder;
20930
20948
  var customPlaceholderSet = false;
@@ -21171,6 +21189,7 @@ Fit.Controls.WSDropDown = function(ctlId)
21171
21189
  var skipUpdateActionMenuOnChange = false;
21172
21190
 
21173
21191
  actionMenu = new Fit.Controls.ListView(me.GetId() + "__ActionsListView");
21192
+ actionMenu.HtmlAllowed(true);
21174
21193
  actionMenu.OnSelect(function(sender, item) // Using OnSelect instead of OnItemSelectionChanging since DropDown fires OnItemSelectionChanging when selection is changed, which would result in OnItemSelectionChanging being executed multiple times
21175
21194
  {
21176
21195
  if (item.Value === "SearchMore")
@@ -21596,6 +21615,21 @@ Fit.Controls.WSDropDown = function(ctlId)
21596
21615
  return base(val);
21597
21616
  });
21598
21617
 
21618
+ this.HtmlAllowed = Fit.Core.CreateOverride(this.HtmlAllowed, function(val)
21619
+ {
21620
+ Fit.Validation.ExpectBoolean(val, true);
21621
+
21622
+ if (Fit.Validation.IsSet(val) === true)
21623
+ {
21624
+ tree.HtmlAllowed(val);
21625
+ list.HtmlAllowed(val);
21626
+ me.ActionMenuHtmlAllowed(val);
21627
+ base(val);
21628
+ }
21629
+
21630
+ return base();
21631
+ });
21632
+
21599
21633
  this.InputEnabled = Fit.Core.CreateOverride(this.InputEnabled, function(val)
21600
21634
  {
21601
21635
  Fit.Validation.ExpectBoolean(val, true);
@@ -21801,6 +21835,23 @@ Fit.Controls.WSDropDown = function(ctlId)
21801
21835
  return useActionMenuSortingLocale;
21802
21836
  }
21803
21837
 
21838
+ /// <function container="Fit.Controls.WSDropDown" name="ActionMenuHtmlAllowed" access="public" returns="boolean">
21839
+ /// <description> Get/set value indicating whether HTML is allowed (shown) in selected items in action menu </description>
21840
+ /// <param name="val" type="boolean" default="undefined"> If defined, True enables support for HTML, False disables it </param>
21841
+ /// </function>
21842
+ this.ActionMenuHtmlAllowed = function(val)
21843
+ {
21844
+ Fit.Validation.ExpectBoolean(val, true);
21845
+
21846
+ if (Fit.Validation.IsSet(val) === true && val !== useActionMenuHtmlAllowed)
21847
+ {
21848
+ useActionMenuHtmlAllowed = val;
21849
+ updateActionMenu();
21850
+ }
21851
+
21852
+ return useActionMenuHtmlAllowed;
21853
+ }
21854
+
21804
21855
  /// <function container="Fit.Controls.WSDropDown" name="ResetActionMenu" access="public">
21805
21856
  /// <description>
21806
21857
  /// Reset action menu so it automatically determines whether to show up or not
@@ -21841,7 +21892,7 @@ Fit.Controls.WSDropDown = function(ctlId)
21841
21892
 
21842
21893
  Fit.Internationalization.RemoveOnLocaleChanged(localize);
21843
21894
 
21844
- me = list = tree = actionMenu = search = forceNewSearch = hideLinesForFlatData = dataRequested = dataLoading /*= nodesPopulated*/ = requestCount = onDataLoadedCallback = suppressTreeOnOpen = timeOut = currentRequest = classes = autoUpdatedSelections = useActionMenu = useActionMenuForced = useActionMenuAfterLoad = treeViewEnabled = orgPlaceholder = customPlaceholderSet = translations = onRequestHandlers = onResponseHandlers = null;
21895
+ me = list = tree = actionMenu = search = forceNewSearch = hideLinesForFlatData = dataRequested = dataLoading /*= nodesPopulated*/ = requestCount = onDataLoadedCallback = suppressTreeOnOpen = timeOut = currentRequest = classes = autoUpdatedSelections = useActionMenu = useActionMenuForced = useActionMenuAfterLoad = useActionMenuSortingLocale = useActionMenuHtmlAllowed = treeViewEnabled = orgPlaceholder = customPlaceholderSet = translations = onRequestHandlers = onResponseHandlers = null;
21845
21896
 
21846
21897
  base();
21847
21898
  });
@@ -22174,7 +22225,7 @@ Fit.Controls.WSDropDown = function(ctlId)
22174
22225
 
22175
22226
  Fit.Array.ForEach(selectedItems, function(item)
22176
22227
  {
22177
- actionMenu.AddItem((addRemoveAll === true ? " &nbsp; &nbsp; &nbsp; " : "") + delIcon + translations.Remove + " " + item.Title, "Remove:" + item.Value);
22228
+ actionMenu.AddItem((addRemoveAll === true ? " &nbsp; &nbsp; &nbsp; " : "") + delIcon + translations.Remove + " " + (useActionMenuHtmlAllowed === false ? Fit.String.StripHtml(item.Title) : item.Title), "Remove:" + item.Value); // HTML might be allowed in DropDown control but not in ActionMenu, so we strip it away to avoid HTML code in selections
22178
22229
  });
22179
22230
  }
22180
22231
 
@@ -23751,7 +23802,7 @@ Fit.Controls.Input = function(ctlId)
23751
23802
  //return designEditorDetached.GetFocused();
23752
23803
  }
23753
23804
 
23754
- elm = input;
23805
+ var elm = input;
23755
23806
 
23756
23807
  if (me.DesignMode() === true)
23757
23808
  {
@@ -27807,6 +27858,7 @@ Fit.Controls.ListView = function(controlId)
27807
27858
  var scrollPositionTop = 0;
27808
27859
  var highlightFirst = false;
27809
27860
  var firstWasHighlighted = false;
27861
+ var htmlAllowed = false;
27810
27862
  var isIe8 = (Fit.Browser.GetInfo().Name === "MSIE" && Fit.Browser.GetInfo().Version === 8);
27811
27863
 
27812
27864
  var onSelectHandlers = [];
@@ -27953,6 +28005,36 @@ Fit.Controls.ListView = function(controlId)
27953
28005
  // Public
27954
28006
  // ============================================
27955
28007
 
28008
+ /// <function container="Fit.Controls.ListView" name="HtmlAllowed" access="public" returns="boolean">
28009
+ /// <description> Get/set value indicating whether HTML is allowed (shown) in ListView items </description>
28010
+ /// <param name="val" type="boolean" default="undefined"> If defined, True enables support for HTML, False disables it </param>
28011
+ /// </function>
28012
+ this.HtmlAllowed = function(val)
28013
+ {
28014
+ Fit.Validation.ExpectBoolean(val, true);
28015
+
28016
+ if (Fit.Validation.IsSet(val) === true && htmlAllowed !== val)
28017
+ {
28018
+ htmlAllowed = val;
28019
+
28020
+ // Update view
28021
+
28022
+ Fit.Array.ForEach(list.children, function(entry)
28023
+ {
28024
+ if (val === false)
28025
+ {
28026
+ Fit.Dom.Text(entry, Fit.String.StripHtml(entry._orgTitle));
28027
+ }
28028
+ else
28029
+ {
28030
+ entry.innerHTML = entry._orgTitle;
28031
+ }
28032
+ });
28033
+ }
28034
+
28035
+ return htmlAllowed;
28036
+ }
28037
+
27956
28038
  /// <function container="Fit.Controls.ListView" name="AddItem" access="public">
27957
28039
  /// <description> Add item to ListView </description>
27958
28040
  /// <param name="title" type="string"> Item title </param>
@@ -27964,7 +28046,17 @@ Fit.Controls.ListView = function(controlId)
27964
28046
  Fit.Validation.ExpectString(value);
27965
28047
 
27966
28048
  var entry = document.createElement("div");
27967
- entry.innerHTML = title;
28049
+ entry._orgTitle = title;
28050
+
28051
+ if (me.HtmlAllowed() === false)
28052
+ {
28053
+ Fit.Dom.Text(entry, Fit.String.StripHtml(title));
28054
+ }
28055
+ else
28056
+ {
28057
+ entry.innerHTML = title;
28058
+ }
28059
+
27968
28060
  Fit.Dom.Data(entry, "value", encode(value));
27969
28061
  Fit.Dom.Data(entry, "active", "false");
27970
28062
 
@@ -28236,7 +28328,7 @@ Fit.Controls.ListView = function(controlId)
28236
28328
  me.Destroy(true); // PickerBase.Destroy()
28237
28329
  }
28238
28330
 
28239
- me = list = active = persistView = scrollPositionTop = highlightFirst = firstWasHighlighted = isIe8 = onSelectHandlers = onSelectedHandlers = null;
28331
+ me = list = active = persistView = scrollPositionTop = highlightFirst = firstWasHighlighted = htmlAllowed = isIe8 = onSelectHandlers = onSelectedHandlers = null;
28240
28332
  });
28241
28333
 
28242
28334
  // ============================================
@@ -28281,7 +28373,7 @@ Fit.Controls.ListView = function(controlId)
28281
28373
  function convertItemElementToObject(elm)
28282
28374
  {
28283
28375
  Fit.Validation.ExpectDomElement(elm);
28284
- return { Title: Fit.Dom.Text(elm), Value: decode(Fit.Dom.Data(elm, "value")) }; // Using Text(..) to get rid of HTML formatting
28376
+ return { Title: elm._orgTitle, Value: decode(Fit.Dom.Data(elm, "value")) };
28285
28377
  }
28286
28378
 
28287
28379
  function setActive(elm, suppressScrollIntoView)
@@ -29302,6 +29394,7 @@ Fit.Controls.TreeView = function(ctlId)
29302
29394
  me._internal.Data("multiselect", "false");
29303
29395
  me._internal.Data("wordwrap", "false");
29304
29396
  me._internal.Data("picker", "false");
29397
+ me._internal.Data("htmlallowed", "false");
29305
29398
 
29306
29399
  // Create internal root node to hold children
29307
29400
 
@@ -29725,6 +29818,31 @@ Fit.Controls.TreeView = function(ctlId)
29725
29818
  return (me._internal.Data("wordwrap") === "true");
29726
29819
  }
29727
29820
 
29821
+ /// <function container="Fit.Controls.TreeView" name="HtmlAllowed" access="public" returns="boolean">
29822
+ /// <description> Get/set value indicating whether HTML is allowed (shown) in TreeView nodes </description>
29823
+ /// <param name="val" type="boolean" default="undefined"> If defined, True enables support for HTML, False disables it </param>
29824
+ /// </function>
29825
+ this.HtmlAllowed = function(val)
29826
+ {
29827
+ Fit.Validation.ExpectBoolean(val, true);
29828
+
29829
+ if (Fit.Validation.IsSet(val) === true)
29830
+ {
29831
+ me._internal.Data("htmlallowed", val.toString());
29832
+
29833
+ // Update view for all nodes recursively
29834
+
29835
+ var nodes = rootNode.GetChildren();
29836
+
29837
+ Fit.Array.ForEach(nodes, function(node)
29838
+ {
29839
+ node.HtmlAllowed(val, true); // Recursive
29840
+ });
29841
+ }
29842
+
29843
+ return (me._internal.Data("htmlallowed") === "true");
29844
+ }
29845
+
29728
29846
  /// <function container="Fit.Controls.TreeView" name="Selectable" access="public" returns="boolean">
29729
29847
  /// <description>
29730
29848
  /// Get/set value indicating whether user can change selection state of nodes.
@@ -31087,15 +31205,23 @@ Fit.Controls.TreeView = function(ctlId)
31087
31205
  init();
31088
31206
  }
31089
31207
 
31208
+ /// <container name="Fit.Controls.TreeViewNodeOptions">
31209
+ /// <description> Options for TreeViewNode </description>
31210
+ /// <member name="HtmlAllowed" type="boolean" default="undefined"> Value indicating whether HTML is allowed (shown) in TreeView node </member>
31211
+ /// </container>
31212
+
31090
31213
  /// <function container="Fit.Controls.TreeViewNode" name="TreeViewNode" access="public">
31091
31214
  /// <description> Create instance of TreeViewNode </description>
31092
31215
  /// <param name="displayTitle" type="string"> Node title </param>
31093
31216
  /// <param name="nodeValue" type="string"> Node value </param>
31217
+ /// <param name="options" type="Fit.Controls.TreeViewNodeOptions" default="undefined"> Optional options </param>
31094
31218
  /// </function>
31095
- Fit.Controls.TreeViewNode = function(displayTitle, nodeValue)
31219
+ Fit.Controls.TreeViewNode = function(displayTitle, nodeValue, options)
31096
31220
  {
31097
31221
  Fit.Validation.ExpectString(displayTitle);
31098
31222
  Fit.Validation.ExpectString(nodeValue);
31223
+ Fit.Validation.ExpectObject(options, true);
31224
+ Fit.Validation.ExpectBoolean((options || {}).HtmlAllowed, true);
31099
31225
 
31100
31226
  var me = this;
31101
31227
  var nodeTitle = null;
@@ -31108,6 +31234,7 @@ Fit.Controls.TreeViewNode = function(displayTitle, nodeValue)
31108
31234
  var childrenArray = [];
31109
31235
  var lastChild = null;
31110
31236
  var behavioralNodeCallback = null;
31237
+ var htmlAllowed = options && options.HtmlAllowed === true || false;
31111
31238
 
31112
31239
  // ============================================
31113
31240
  // Init
@@ -31139,6 +31266,36 @@ Fit.Controls.TreeViewNode = function(displayTitle, nodeValue)
31139
31266
  // Public
31140
31267
  // ============================================
31141
31268
 
31269
+ /// <function container="Fit.Controls.TreeViewNode" name="HtmlAllowed" access="public" returns="boolean">
31270
+ /// <description> Get/set value indicating whether HTML is allowed (shown) in TreeView node </description>
31271
+ /// <param name="val" type="boolean" default="undefined"> If defined, True enables support for HTML, False disables it </param>
31272
+ /// <param name="recursive" type="boolean" default="undefined"> If defined, True applies change recursively to children </param>
31273
+ /// </function>
31274
+ this.HtmlAllowed = function(val, recursive)
31275
+ {
31276
+ Fit.Validation.ExpectBoolean(val, true);
31277
+ Fit.Validation.ExpectBoolean(recursive, true);
31278
+
31279
+ if (Fit.Validation.IsSet(val) === true)
31280
+ {
31281
+ htmlAllowed = val;
31282
+
31283
+ // Update view - optionally update children recursively
31284
+
31285
+ me.Title(me.Title());
31286
+
31287
+ if (recursive === true)
31288
+ {
31289
+ Fit.Array.ForEach(childrenArray, function(child)
31290
+ {
31291
+ child.HtmlAllowed(val, true);
31292
+ });
31293
+ }
31294
+ }
31295
+
31296
+ return htmlAllowed;
31297
+ }
31298
+
31142
31299
  /// <function container="Fit.Controls.TreeViewNode" name="Title" access="public" returns="string">
31143
31300
  /// <description> Get/set node title </description>
31144
31301
  /// <param name="val" type="string" default="undefined"> If defined, node title is updated </param>
@@ -31149,11 +31306,19 @@ Fit.Controls.TreeViewNode = function(displayTitle, nodeValue)
31149
31306
 
31150
31307
  if (Fit.Validation.IsSet(val) === true)
31151
31308
  {
31152
- lblTitle.innerHTML = val;
31153
- nodeTitle = Fit.Dom.Text(lblTitle); // Get rid of HTML formatting for return value
31309
+ nodeTitle = val;
31154
31310
 
31155
- // Make sure any contained links do not receive focus when navigating TreeView with Tab/Shift+Tab
31156
- Fit.Array.ForEach(lblTitle.getElementsByTagName("a"), function(link) { link.tabIndex = -1; });
31311
+ if (htmlAllowed === false)
31312
+ {
31313
+ Fit.Dom.Text(lblTitle, Fit.String.StripHtml(val));
31314
+ }
31315
+ else
31316
+ {
31317
+ lblTitle.innerHTML = val;
31318
+
31319
+ // Make sure any contained links do not receive focus when navigating TreeView with Tab/Shift+Tab
31320
+ Fit.Array.ForEach(lblTitle.getElementsByTagName("a"), function(link) { link.tabIndex = -1; });
31321
+ }
31157
31322
  }
31158
31323
 
31159
31324
  return nodeTitle;
@@ -31749,7 +31914,7 @@ Fit.Controls.TreeViewNode = function(displayTitle, nodeValue)
31749
31914
  }
31750
31915
 
31751
31916
  // Dispose private members
31752
- me = nodeTitle = elmLi = elmUl = cmdToggle = chkSelect = lblTitle = childrenIndexed = childrenArray = lastChild = behavioralNodeCallback = null;
31917
+ me = nodeTitle = elmLi = elmUl = cmdToggle = chkSelect = lblTitle = childrenIndexed = childrenArray = lastChild = behavioralNodeCallback = htmlAllowed = null;
31753
31918
  }
31754
31919
 
31755
31920
  /// <function container="Fit.Controls.TreeViewNode" name="GetDomElement" access="public" returns="DOMElement">
@@ -33316,7 +33481,7 @@ Fit.Controls.WSTreeView = function(ctlId)
33316
33481
 
33317
33482
  // Convert JSON to TreeView node, including all contained children
33318
33483
 
33319
- var child = new Fit.Controls.TreeViewNode((jsonNode.Title ? jsonNode.Title : jsonNode.Value), jsonNode.Value);
33484
+ var child = new Fit.Controls.TreeViewNode((jsonNode.Title ? jsonNode.Title : jsonNode.Value), jsonNode.Value, { HtmlAllowed: me.HtmlAllowed() });
33320
33485
 
33321
33486
  if (jsonNode.Selectable !== undefined)
33322
33487
  child.Selectable((jsonNode.Selectable === true)); // Node will obtain Selectable state from TreeView unless explicitly set here