 |
|
|
Does anyone know if it is possible to sort a column by the second word in the column? This would be useful in the case of sorting by last name.
John Rogers www.cerberus.com.au
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
so.. I'm a noob trying to make my site function - no luck yet.
"All you need to do is give your table an ID field, include the sortTable.js file and call initTable in your document's onLoad method."
was hoping to get this to sort my tables for ppl visiting. downloaded the file, put it in my folder (where all my html stuff is) and copied the codes on this page.. Nothing happened.
so.. how to give my table an ID field? then.. how to include the sortTable.js? and.. what is my document's onLoad method?
ty
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
In the table html code include ID="table0"
Include the following in the head of your page
<script> //Sortable table script- Han Yu han@velocityhsi.com //Script featured on http://www.javascriptkit.com var domok=document.all||document.getElementById if (domok) document.write('<SCRIPT SRC="sortTable.js"><\/SCRIPT>') </script>
As I use other scripts on the same page I find the best way to call the script is by adding the following at the bottom of the page just before
<img src="off.gif" width="1" height="1" border="0" onLoad='if (domok) initTable("table0")'>
To use this method you will need a gif image named off.gif. This is a one pixel image that is so small that it is not seen.
John Rogers www.cerberus.com.au
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
how do you go about setting a column to ignore? I have one column that I don't want to be sorted at all, how do I do that? Thanks in advance!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
hi everybody......... im a beginner in IT field.. in my company now my module is to create a forum.. i have no more idea in this.. if anybody know this..... plz share it to me.... im waiting for your reply
how to create forums using javascript and html
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Just a comments: This script works great. Had some simple tables that I needed a way to sort (writing differnt sql's was going to be a pain)
Thanks!
Rod 
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Great code and very clever idea. My problem is that I have a drop down inside a columns that I don't want to execute the script when I click, like:
| Id | <select önchange="doAction()"><option value="1">users</option><option value="2">users</option></select> | country |
|
I tryed to set the "colsToIgnore" but it never match the <select>. How can I disable the script for the columns I specify?
Thank you for your time
JS
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
can any one help me how to set fixed header in table with scroll hich work both in ie and mozilla
JAYARAJ
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
Hi,
First and foremost - Great script!!!
I had quick question about your script.
I am using your sort script along with another filter script. Everytime the table is filtered - the table would need to be reinitialized by the init function in your script so it can set up for the new filtered table.
Likewise...inside the method that is called everytime a heading is clicked...I call the init function similarly like I do in the header.
initTable(document.getElementById('tb1'));
The end result is a sorted table, of as many rows as teh filtered tables...but sorted from all the rows of the entire table rather than just the filtered rows.
I believe the problem is the table is not getting properly initialized. What can I do to start fresh with the table everytime I filter? So it recalculates everything just the way it is?
A response would really help I've been stuck on this for quite some time...
Thanks!
Akshay
ahooja
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, I am using this javascript in my application, it is excellent. But I do have some empty cells in the integer field, its not sorting it properly. Please advice?
Thanks, YS
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Hello, First of all thanks for such a great javascript that has helped me so much. Its firfectly working fine except for the column with checkbox. I have a grid which displays a column containing checkbox along with other columns. This check box can be checked or unchecked. How do I sort on this column (so that all checked ones are shown on top for ascending ) ?
Thanks in advance, CG
|
| Sign In·View Thread·PermaLink | 1.50/5 (4 votes) |
|
|
|
 |
|
|
Hi, This script is pretty useful to us in letting us sort the tables quite quickly. So, thanks for this. However, in our application we use a date format (DD-MON-YY for example, 01-JAN-05). This script is not sorting this date. Could you let me know is there any changes I can do to this script which will sort dates in the above format.
Thanks in advance.
Dhanraj.
|
| Sign In·View Thread·PermaLink | 2.25/5 (4 votes) |
|
|
|
 |
|
|
 |
|
|
How would I go about changing the table that the data is sorted by?
<TABLE ID="table0" align="center"> <TBODY> <TR><TD>Name</TD><TD>City</TD><TD>Genre</TD><TD>Links</TD></TR> <tr><td valign="top">Rotoscope</td><td valign="top">Arlington, VA</td><td valign="top">Pop</td><td valign="top"><a href="http://www.myspace.com/rotoscope" target="_blank">on myspace</a><br><a href="http://www.rotoscope.com" target="_blank">on the web</a></td></tr> <tr bgcolor="#CCCCCC"><td valign="top">Waking State</td><td valign="top">Washington, DC</td><td valign="top">Rock</td><td valign="top"><a href="http://www.myspace.com/wakingstate" target="_blank">on myspace</a><br><a href="http://www.wakingstate.net" target="_blank">on the web</a></td></tr> </TABLE>
Right now it sorts by the first column (Name). I'd like to be able to switch it to be able to sort by the second column (City).
Also, would it be possible to make the table searchable by more then one column? Like either City or Genre depending on the users preference?
~Crystal
|
| Sign In·View Thread·PermaLink | 2.00/5 (4 votes) |
|
|
|
 |
|
|
 |
|
|
Nice script! But I found a problem when using Firefox.
You're using getAttribute('className') to get the current cell style. This works fine with IE but when using Firefox/Mozilla you have to use 'class' instead 'className'..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi I was looking for sort html table code which allows me to skip between rows in my Table. This code works great in a sample html, but when i put it in my project, IE got hung. I tried by debugging the code, it actually goes till end of the code and gets hanged. Can u please help me in this. Did anyone experience same sort of problem with this.
Thanks in Advance, Pavani.
|
| Sign In·View Thread·PermaLink | 1.80/5 (5 votes) |
|
|
|
 |
|
|
I am having trouble getting this to format as I wish it. It functions perfectly but I can't manage to set the column and table width i.e. 90% of page width and can't use line breaks.
Is there a way around this?
|
| Sign In·View Thread·PermaLink | 1.00/5 (3 votes) |
|
|
|
 |
|
|
I am using the script dated 9/23/2002 4:41 PM.
The cells that have a link do not work correctly. The data displayed is fine, but the link info does not change. Also, I am using style statements inside the TD and they do not function after a sort.
Does anyone have a fix or workaround?
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
Hello,
Does this Javascript work on the XML web page? I saved an Excel file to a web page(XML format). The Sorting Javascript seems not work with the web page. 
Alan
For HK News, MP3, Shopping, Games & Horoscopes http://www.USWebcity.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You could not put a row with COLSPAN at the end of table.If you do so, the table will not be init corretly. For xample: <TABLE ID="table2" border="1" > <TBODY> <TR><TH>ID</TH><TH>Device ID</TH><TH>Date</TH><TH>Comment</TH></TR> <TR><TD>k</TD><TD>00030</TD><TD>11/09/01 12:14:00 pm</TD><TD>1</TD></TR> <TR><TD>c</TD><TD>00006</TD><TD>11/11/01 12:15:00 pm</TD><TD>2</TD></TR> <TR><TD>a</TD><TD>00016</TD><TD>10/16/01 08:14:00 am</TD><TD>3</TD></TR> <TR><TD>b</TD><TD>00031</TD><TD>09/05/01 10:05:00 am</TD><TD>4</TD></TR> <tr><td colspan=4></td></tr> <!-- added line --> </TABLE>
It is taked from sample.htm with only one line added.
I'm a student in China, and have been learning PC for 7 years. But till now, I'm still a learner.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
Hi,
I'm using an older version of Han Yu's script, however the problem I seem to be facing is the fact that it has problems when there are empty cells in the collumn. For instance it will do something like this:
12 13 14
9 10
1 5 7
As you can see, the script restarts its sorting routine after the empty cell. What I want is to have the empty cells sorted at the top or bottom (doesn't really matter seeing you can resort the table the otherway).
Does somebody have a solution to this? (the newer version of the script is much to slow and doesn't fix this problem either).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
This script seems to be very slow when used with tables having more than 500 rows. I've used it with 600 rows and it took 3-4 mins to sort the table. My main purpose to use this script is to provide some client side scripting to avoid the database call for sorting but i'm kind of losing this purpose.
Please let me know if there is any solution to increase the speed.
Regards, Amit
Amit
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
While Javascript can't be the solution anyway to sort large chunks of data, I would recommend to use the ActiveX TDC (tabular data control) which is part of Internet Explorer. The TDC provides a sort method which does all the required stuff.
-- modified at 10:35 Friday 14th October, 2005
|
| Sign In·View Thread·PermaLink | 3.50/5 (2 votes) |
|
|
|
 |
|
|
Want to get solution for real world ( I mean large data ), use XML, XSLT and Javascript. I will show you guys my code with big performance when I get time.
::Qing
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |