Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 26th, 2008, 03:02 PM
thegreatone thegreatone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 thegreatone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 31 sec
Reputation Power: 0
Exclamation Help modifying spry script

Hi guys i've been looking through adobes spry functions

and i found this script was being used to remove states that began with a certain letter. i've been wondering if any1 could help me in editting the script so if a button is pressed the only "alabama" state would show.

heres the script
[CODE]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Multiple Filters Sample</title>
<link href="../../css/samples.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="../../includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="../../includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="../../includes/SpryDataExtensions.js"></script>
<script type="text/javascript">
<!--
var dsStates = new Spry.Data.XMLDataSet("../../data/states/states.xml", "states/state");

function ffAH(ds, row, index){ var c = row.name.charAt(0); return c >= 'A' && c <= 'H' ? null : row; };
function ffIP(ds, row, index){ var c = row.name.charAt(0); return c >= 'I' && c <= 'P' ? null : row; };
function ffQZ(ds, row, index){ var c = row.name.charAt(0); return c >= 'Q' && c <= 'Z' ? null : row; };

function ToggleFilter(enable, f)
{
RemoveAllFilters();
if (enable)
dsStates.addFilter(f, true);
else
dsStates.removeFilter(f, true);
}

function RemoveAllFilters()
{
document.forms[0]["fAH"].checked = false;
document.forms[0]["fIP"].checked = false;
document.forms[0]["fQZ"].checked = false;

dsStates.removeAllFilters(true);
}
-->
</script>
<style type="text/css">
<!--
.badge {
float: left;
margin: 4px;
padding: 4px;
text-align: center;
background-color: #FFCC99;
border-top: solid 1px #999999;
border-left: solid 1px #999999;
border-bottom: solid 1px #CCCCCC;
border-right: solid 1px #CCCCCC;
}

label {
font-weight: bold;
}
-->
</style>
</head>
<body>
<h3>Multiple Filters Sample</h3>
<p>This page demonstrates how to use the multiple filter support for data sets.</p>
<p>Here is a working example that uses multiple filters.</p>
<div class="liveSample" style="float: left; margin-bottom: 4px;">
<form action="">
<label>Filter out 'A' - 'H': <input name="fAH" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffAH);" /></label>
<label>Filter out 'I' - 'P': <input name="fIP" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffIP);" /></label>
<label>Filter out 'Q' - 'Z': <input name="fQZ" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffQZ);" /></label>
<input type="button" value="Remove All Filters" onclick="RemoveAllFilters();" />
<input type="button" value="Remove A-H" onclick=" ToggleFilter(this, ffAH);" />
<input type="button" value="Remove I-P" onclick=" ToggleFilter(this, ffIP);" />
<input type="button" value="Remove Q-Z" onclick=" ToggleFilter(this, ffQZ);" />
</form>
<p spry:region="dsStates" spry:repeatchildren="dsStates">
<span class="badge">{name}</span>
</p>
</div>
<p><br style="clear: both;" />
</p>
<p>&nbsp;</p>
</body>
</html>
CODE]

thanks

Reply With Quote
  #2  
Old July 9th, 2008, 02:59 PM
jgifford jgifford is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Location: Dayton, OH
Posts: 1 jgifford User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 57 sec
Reputation Power: 0
RE: Spry Filter Functions

Not sure if you still need this, but you could just make a function like the following:

function ffAlabama(ds, row, index){ return (row.name == "Alabama") ? row : null; };

Hope that helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Help modifying spry script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT