Source Code & Description
r.a.d.combobox provides a set of client-side events. Here's a list of all client-side events exposed:
OnClientSelectedIndexChanging
OnClientDropDownClosing
OnClientDropDownOpening
OnClientItemsRequested
OnClientItemsRequesting
The client-event is essentially a string which specifies the javascript function to execute when an event is fired. The function may receive different numbers of parameters. Some of the events can be cancelled (usually all "before" events, which by convention end with "ing"). To cancel a "before" event, simply return false from your javascript event-handler function.
- OnClientSelectedIndexChanging - one parameter - the instance of the selected node. Event can be cancelled.
- OnClientDropDownClosing - one parameter - the instance of the combobox firing the event. Event can be cancelled.
- OnClientDropDownOpening - one parameter - the instance of the combobox firing the event. Event can be cancelled.
- OnClientItemsRequesting - three parameters - one parameter - the instance of the combobox firing the event, the text requested and a boolean showing if the items will be appended or current items will be replaced. Event can be cancelled.
- OnClientItemsRequested - three parameters - one parameter - the instance of the combobox firing the event, the text requested and a boolean showing if the items will be appended or current items will be replaced.
Passing custom client-data to the callback ItemsRequested event handler
Sometimes you may need to pass custom data to the server in the ItemsRequested combobox event handler. This can be achieved using
the ClientDataString client-side property - just set it to any value and the property will be available on the server in the ItemsRequested
event handler (in the ClientDataString property of the event-args). A convenient way to keep the string in sync with your current form data is to hook
the OnClientItemsRequesting client-side event handler that fires just prior to the callback and update the string there. If you have multiple values
that need to be sent back to the server you can use delimeters (comma, semi-colon, etc) and split the string into an array on the server.
