Search
ListContainer.selectionChanged Event
See Also
 






Raised when the selection collection is changed.

Namespace: MindFusion.Common.UI
File: ListContainer.js

 Syntax

JavaScript  Copy Code

EventDispatcher selectionChanged

 Event Data

The event handler method receives the following arguments:
sender
A ListContainer instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A NotifyCollectionChangedEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following code handles the selectionChanged event of a ListView object. The ListView class derives from ListContainer.

JavaScript  Copy Code

listView = new ui.ListView(document.getElementById("listView"));
listView.selectionChanged.addEventListener(listSelectionChanged);

function listSelectionChanged(sender, args)
{
 if (args.oldItems)
 {
  args.oldItems.forEach(function (item)
  {
   item.data.style.backgroundColor = "";
  });
 }
 else
 {
  args.newItems.forEach(function (item)
  {
   item.data.style.backgroundColor = "#9caac6";
  });
 }
}

 See Also