Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2004, 04:29 PM
Registered User
Join Date: Oct 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sorting 2 dimensional array

In JavaScript to sort a single demensional array named 'users' we use the sort method as follows --> users.sort();

Let's say we have a two dimensional array named 'users' with three fields defined as follows,

users[indx] = new Array();
users[indx][0] = name;
users[indx][1] = dept;
users[indx][2] = date;

The default sort for two demensional arrays seems to sort by the first field, ie name. Is it possible to sort by another field, ie dept or date. What is the syntax.

Reply With Quote
  #2 (permalink)  
Old February 11th, 2004, 12:04 PM
Friend of Wrox
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts

Cross post to here.

Reply With Quote
  #3 (permalink)  
Old December 2nd, 2006, 10:46 AM
Registered User
Join Date: Dec 2006
Location: izmir, , Turkey.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to leoparsd

try this link http://www.breakingpar.com/bkp/home....256C8D00514FA4

if this doesn't open, then just type http://www.breakingpar.com and search with keywords sort array you will see the solution there

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
using 2 dimensional array Abraham EJB 0 July 17th, 2007 09:27 AM
two-dimensional array Lizane Java Basics 4 May 23rd, 2007 09:35 AM
2 dimensional array trangd Beginning PHP 0 August 18th, 2005 12:37 AM
2 dimensional array venterjo General .NET 2 January 23rd, 2005 09:04 AM
sorting two dimensional array erin VBScript 0 February 10th, 2004 05:55 PM

All times are GMT -4. The time now is 05:13 AM.

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