SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1082 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


CROSS-REF CROSS-REF
TIP TIP
605
Powering Ajax Pages with Spry 18
FIGURE 18-10
The same data can be presented in a multitude of ways through the Spry Repeat List object.
606
Adding Advanced Design Features Part III
Restricting Repeated Spry Data
Use of either Spry repeat attribute returns all of the data in the associated XML data source. There are times
you might want limit or filter the data returned. Spry includes a couple of conditional attributes that you
can use to restrict the data displayed: spry:if and spry:choose.
The spry:if attribute evaluates a JavaScript expression, which can include the Spry data column. If the
expression evaluates to zero, the data is not shown. Here??™s an example that uses regular expressions to find
display only those data entries in the Spry name data column that start with an ???A???:
  • {name}

  • The spry:if attribute either displays the data or doesn??™t. To provide multiple responses??”similar to an
    if/then clause??”you can use the spry:choose attribute, like this:

    {name}

    No New York entries were
    found.


    For more details on Spry conditional coding, see http://labs.


    Pages:
    1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094