Vie (0) Tulosta
Laajenna kaikki
all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize
EN
Tätä sisältöä ei ole saatavilla kielelläsi. Tässä on englanninkielinen versio.

datasrc attribute | dataSrc property

Sets or retrieves the source of the data for data binding.

Syntax

HTML<element datasrc="p" ... >
JavaScript

p = object.dataSrc

 

Property values

Type: String

the identifier of the data source.

Remarks

The dataFld property is not available on param objects; use getAttribute('dataFld') instead.

Tabular and single-valued data consumers use the dataSrc property to specify a binding. The property takes a string that corresponds to the unique identifier of a data source object (DSO) on the page. The string must be prefixed by a number sign (#).

When the dataSrc property is applied to a tabular data consumer, the entire data set is repeated by the consuming elements.

When the dataSrc property is applied to a table, any contained single-valued consumer objects that specify a dataFld property are repeated for each record in the supplied data set. To complete the binding, the binding agent interrogates the enclosing table for its data source. A tabular data consumer contained within another tabular data consumer (table) must specify an explicit dataSrc.

Examples

In this example, a text box is bound to the customer_name field of a data source object with an ID of "customer." Because the text box is located in a data-bound table, it is repeated to display each of the records provided by the data source.


<table datasrc="#customer"> 
   <tr><td><input type="textbox" datafld="customer_name"><td><tr>
</table>

See also

a
applet
button
div
frame
iframe
img
input type=button
input type=checkbox
input type=email
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=search
input type=tel
input type=text
input type=url
label
legend
marquee
object
option
select
span
table
textArea
Introduction to Data Binding

 

 

Näytä:
© 2014 Microsoft