Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 1st, 2006, 08:19 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sorting in Javascript.

Hi all,

Please provide the links/resources for implementing sort by price, sort by brand (similar to Adobe's flex store) using Javascript.


Thanks in advance,
Tan

  #2 (permalink)  
Old July 2nd, 2006, 10:04 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

why would you want to do this with javascript?
Some questions:
1. Do you want to use the javascript serverside or clientside
2. do you retrieve the data from a database.
3. Are you using server pages such as php asp or jsp .

If you have a awnser to these questions you can solve the problem

__________________________________________________ ________
This is my junk I'm gona eat it
  #3 (permalink)  
Old July 3rd, 2006, 01:16 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dj Kat,

I am using the AJAX technique, so Javascript comes into picture.

1. I am using Javascript on the Client side.
2. I am retrieving data from XML file.
3. I am not using any server pages.

u can contact me @ tanveer.naveed@gmail.com


  #4 (permalink)  
Old July 3rd, 2006, 05:45 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you do not use server pages like php jsp or aps then this is not AJAX.

You can find the awnser with JavaScript DOM to retrieve data from a xml file. the things you can do is give the xml tags attributes like:
Code:
<xmltag id="1" />
You can also solve this problem with the ol tag
Code:
<ol>
<li></li>
</ol>
this will order your information with html

__________________________________________________ ________
This is my junk I'm gona eat it
  #5 (permalink)  
Old July 12th, 2006, 05:23 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you like Adobe's Flex store interface, but would rather use HTML for your interface, you should try Adobe's Spry Framework for AJAX. It provides similar sorting, XPath lookup, and binding capabilities as Flex.

http://labs.adobe.com/technologies/spry/

Jon Emerson
Computer Scientist, Adobe Systems
http://www.jonemerson.net/
  #6 (permalink)  
Old July 12th, 2006, 05:30 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DJ Kat,

While many developers prefer to generate XML dynamically for use with AJAX, from a purists perspective it is unneccessary. The XML retrieved with the asynchronous Javascript call can absolutely be pregenerated XML located on a server.

Additionally, the <ol> tag in HTML/XHTML does not provide sorting capabilities. The purpose of this tag is purely semantic: it denotes that the data contained within the list items have some semblance of order. There is little difference between <ol> and[list] from a functional perspective, other than <ol> lists typically are preceded by numbers, while[list] lists are preceded by bullets.

Jon Emerson
http://www.jonemerson.net/


Similar Threads
Thread Thread Starter Forum Replies Last Post
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
SORTING pallone XSLT 3 October 29th, 2006 08:45 AM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM
Need help Sorting athanatos XSLT 5 August 11th, 2003 07:51 PM
sorting Greg Griffiths Javascript How-To 1 June 20th, 2003 01:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.