behavior:select-multiple

Behavior of <select multiple> lists. In principle it can be applied to any DOM element.

Elements

These elements have behavior:select applied by default:

Model

Same as behavior:select.

Selected options are getting :checked state flag set therefore custom styling of selected state can be made using :checked pseudo-class in CSS:

select > option:checked { background-image: url(my-checkmark.png); }

Attributes

This behavior knows about:

Events

Other than standard set of events (mouse, keyboard, focus) behavior:select-multiple generates:

Methods

N/A - behavior:select-multiple does not introduce any specific methods.

Value

array of values, read/write, list of selected options.

Selection change handling in script

raw onValueChanged handler

var btn = $(select#some);
btn.onValueChanged = function() { var v = this.value; ... }

on() subscription

var btn = $(select#some);
btn.on("change", function() { ... event handling code ... });
self.on("change", "select#some", function() { ... event handling code ... });

decorators.tis handler

include "decorators.tis";
@change @on "select#some" :: ... event handling code ...;