listSetData jQuery Plugin

Binds a list or dropdown control with object data from an array. The data can be a single value array, object array or data table (with a Rows array property). This function should be applied only to select elements.

If no data is passed the list is cleared.

$.fn.listSetData = function(data,opt)

Example

The following example downloads data from the server and returns a table result and binds it to a dropdown list:

function GetDeveloperList(clearList) { Proxy.callMethod('GetDeveloperList',[], function(result) { // Bind company and pk fields $("#lstCustomerList") .listSetData(result,{ dataTextField: "company", dataValueField: "pk"}); },onPageError); }


data
The data that is passed in in the form of a single item array, or an object array or a serialized table that has a Rows array.

If this value is null or not passed the list is cleared.

opt
Options that allow you to specify the dataTextField and dataValueField which should reference the JavaScript object properties.

Note a single item array will bind the single item as both value and text.

Class Members

Requirements

See also:

Class modalDialog

  Last Updated: 10/21/2008 | © West Wind Technologies, 2008