Sponsored by Guitar Center
When Heavy-handed Hints Fail--Guitar Center Wishlist Posters view!
guitarcenter.com - Cool personalized designs send a friendly reminder that a new Stratocaster would rock, thanks.
64 Comments
- gargantuan, on 10/12/2007, -5/+19@Chris9902: Whaa whaa whaa. Yes you can build something in AJAX, just like you can build something in OOP, or build something in a procedural manner. You see, and here's the tricky bit that you might not have been able to understand until now, it's a 'Paradigm'. People say it because it is an abstract term used to describe something a lot larger than the sum of it's parts.
So while grammatically it may be erroneous, I, and the majority of people on digg, understand full well what headzoo was talking about without him/her having to go into more detail. for example: 'I'm gonna build it using AJAX' communicates a lot more than 'I'm gonna build it using some Java script and XML with that nifty xmlhttprequest thingy so i can give it a more dynamic interface.' And if the word AJAX annoys you that much, then go live under a rock because it's here to stay, just like CSS, XML and Flash. - dave_colorado, on 10/12/2007, -0/+13i have a lot of experience in this area.
1. You can't use JavaScript for any real amount of records. Anything above 200 or so makes the code start to crawl, especially if you add search-as-you-type.
2. Ajax transfers too much data over the network. For sorting alone, it is acceptable, however, if you want search-as-you-type which i think is CRUCIAL, you just can't expect users to wait for a callback to the server if they are just typing and want to find a record. imagine if you have 1000 records and you want to have quick, responsive sorting and search as you type. ajax callbacks are too slow.
here is the solution i created (which i am very proud of):
1. load the data as an XML string on the client.
2. use a package like Sarissa that can perform cross-browser XML style sheet transforms.
3. Use XSLT files to perform client-side tranforms on the data.
What's the result?
I can sort about 1000 records in less than a second. Search as you type is even faster.
Also, I do some sophisticated caching of data on the client side. i actually load the XML string in a .js file which is requested off the server. The .js file doesn't actually exist, it's a Java Servlet. When the user requests the .js file, i determine if there have been any changes to the data. If there hasn't been, i send a file back with the same modification date as the one they have stored in their cache. otherwise, i update the modification date so the user downloads a new file.
that way, the user only has to download the file of 1000 records when they need to, and otherwise it is stored in their cache. they download a new file only when changes have been made. it's slick. message me and i'll show you. - tonyellard, on 10/12/2007, -1/+11I've tried sorting tables with JS before...with small table sets it's not too bad, but the larger the table set, the performance drops pretty quicky. If the client machine isn't very robust I'd think twice before doing a straight JS table sort. Consider AJAX or something that makes a call back to a server instead.
- rysolag, on 10/12/2007, -0/+6It breaks down when you introduce paging.
- Grimdotdotdot, on 10/12/2007, -0/+5Why has no-one else noticed that you get a Script Error in IE6 when clicking on the 'Description' field?
I use Firefox, but only 3% of my clients do - so this is no good for me =[
Shame, because in Firefox, it's great... Hopefully the author will read this comment and investigate. - vlademonkey, on 10/12/2007, -4/+9there's a difference between "built-in" (what you meant) and "built in"
- RobGamble, on 10/12/2007, -1/+5An ActiveWidgets license costs $395.
http://activewidgets.com/licenses/
This script:
http://friedcellcollective.net/js/SortedTable/SortedTable.js
...is listed under the reateive Commons license. That make make a huge difference to many developers. - arnar, on 10/12/2007, -0/+4@dave_colorado: I'd like to message you, but I don't know how :o(
- Kitsune818, on 10/12/2007, -1/+5@gargantuan:
Actually, I believe you are mistaken, I think he meant it had inate AJAX functionality, not that it was created in that type of environment. Grammar error, pure and simple. (And I read it as "created in", personally)
That's unimportant though.. what really sucks is that we still have to use @someone instead of actual threading. We're being deceived!! (that's a joke btw :) ) - Torrent, on 10/12/2007, -0/+3View Source is a great option in most modern browsers :)
http://activewidgets.com/preview/2.0/runtime/lib/aw.js - zeeneo, on 10/12/2007, -2/+5it's probably the browser rendering not the method of getting the data.
- inactive, on 10/12/2007, -0/+3i'm going to jump right out and say, web apps are a pain in the arse and nothing good ever comes of them. browsers do not make a good application platform. look at all the effort that has gone into turning the web into an application platform, and it still sucks balls.
i would much rather time and effort be spent on making browsers more standards complient and on technologies to make them faster at rendering and at displaying information in more innovative ways. - casiotone, on 10/12/2007, -2/+4last time i checked it was perfectly possible to build something with asynchronous javascript & xml.
- Xopl, on 10/12/2007, -0/+2@dave_colorado
You should write something up and submit it to digg. - dave_colorado, on 10/12/2007, -0/+2just email me at d_redfive@yahoo.com. i don't really use that account much anymore since it's flooded in spam, but I'll check a couple times over the next couple days. if you want i'll send some examples your way.
- jackraz, on 10/12/2007, -0/+2Its not really news :-/ However it is a nifty little script that demonstartes the basics.
Unfortunately it works best with small tables. As soon as you start sorting 100-200 rows, the javascript and browser does not perform well.
But still - nice script... - Grimdotdotdot, on 10/12/2007, -0/+2This is tables on a web page, not a file list in windows...
- lexiphanic, on 10/12/2007, -0/+2Nice but doesn't work properly in Safari.
- Chewie67, on 10/12/2007, -0/+2Seems to work fine in Safari for me. Version 2.0.3
- joshduck, on 10/12/2007, -0/+2How large are you talking about? Amd what sort methods did you try? Anything less that a thousand rows and I would say that it's your script that has the problem. JavaScript is slow, but not that slow.
- usidoesit, on 10/12/2007, -0/+2TrimPath! Excellent set of JS tools, including TrimQuery. These are *tools*, not frameworks.
http://trimpath.com/
TrimQuery was very fast. I prototyped it on a one-page replacement of a CGI/perl/xml/xslt small database. The thing that slows the tools down is mainly the templating (Trimpath Templates, a Smarty-like templating system for Javascript), have to use the templating judiciously.
--
http://groups.yahoo.com/group/heuristic/
From Defining The Problem To Continuous Invention. Free books and newsletters. - Chewie67, on 10/12/2007, -0/+2Well, I agree with you....to a degree.
At some point (not too far in the future), we're going to need to scrap the current Internet architecture and get to something more robust if we're going to develop web applications that can rival desktop apps. People today are doing amazing things with HTML, the DOM and JavaScript, but it does have its limits.
A new browser architecture that takes into account dynamic, data-rich applications would be nice, but it will be very painful to make the switch. That may mean the day will never come... - danlemire, on 10/12/2007, -0/+2That's because your are thing of the american date style that goes mm.dd.yy. This example uses dd.mm.yy
- psyon, on 10/12/2007, -0/+2Have you tried the grid on http://www.activewidgets.com/ ??
- Xopl, on 10/12/2007, -0/+1@Chewie67
I'm pretty sure that's what embedded Java applets were for... more robust online applications.
Of course, I dislike Java applets, but that doesn't change their purpose.
The real problem with Java applets is that they are in a little box you can't look into. You can't view source. Copy and Paste isn't a given. Saving source isn't a given. Can't greasemonkey it. And so on.
We need a web app toolset where everything remains XML so that your browser shell, and you the user, still have full access to it.
Of course, with Mr. Gates at Redmond suddenly re-interested in the web browser, they'll probably push something every bit as crunky and proprietary as Active-X. - dipswitch, on 10/12/2007, -0/+1I was planning on using FlexGrid on MSIE and the real grid control with XUL in Mozilla. This could make a nice 3rd option for other browsers.
- Chewie67, on 10/12/2007, -0/+1"Heh, now *that* would be exspensive."
Yes, which is why it will probably never happen. But it needs to. The Internet was a great advancement for IT and Society, but it's a crude first step. We need to take what we've learned, and start over. I'm not sure if Internet2 is that next step or not, but at some point we need to break past our current limitations.
That said, most of us are still running PCs based on DOS and a suped-up 8086 chip -- so I guess I shouldn't hold my breath. - Kitsune818, on 10/12/2007, -0/+1"At some point (not too far in the future), we're going to need to scrap the current Internet architecture "
Heh, now *that* would be exspensive.
HTTP != "the current Internet architecture" - kRabbit, on 10/12/2007, -0/+1To add to this. Consider caching on the server side instead of making numerous calls to the database. Caching is man's 2nd best friend.
- Cmain, on 10/12/2007, -0/+1I was just making some of these in web design class at school. Good stuff for smaller tables.
- rysolag, on 10/12/2007, -1/+2the browser isn't going anywhere. everything will be built on top of the browser.
- danlemire, on 10/12/2007, -0/+1I like the example that moves a table row. It is a pretty simple task, but could be useful for some of my web apps.
- Chewie67, on 10/12/2007, -1/+2It's great for sorting tables without having to post back to the server.
The real limitation, however, is that it can't handle paging. So, it only works for short, one-page tables. - rebrad, on 10/12/2007, -0/+1I hope it works better than comment sorting on digg. Regardless at what you set the default at the sort always returns to an internal default. Set a new sort and make a comment and it again resets to an internal default. Distracting and annoying.
- usidoesit, on 10/12/2007, -0/+1Not sure if you hate browsers or what, but spend a little time trying to construct and deploy the simplest applet on a high-end eval copy of the best enterprise Java IDE -- you will see what a pain that is and how little support there is for that simple exercise. Imagine the cost of developing a real application with it.
You will love the browser, CSS, HTML, JS, after that experience.
Perhaps the reason it seems so bad is that the alternative is unimaginably worse. - SilverRocket, on 10/12/2007, -0/+1This code is fantastic. Just what I was looking for instead of performing 7-table joins to re-order data!
- airdrummer, on 10/12/2007, -0/+1well, the rest of it works in iXploder, but not in ffx2.0a:-( for that matter, neither does digg's reply form)-:
i've used stuart langridge's sorttable.js (http://www.kryogenix.org/code/browser/sorttable/) for some time, and while it does bog down when the table gets large (>900 rows) it's still acceptable, plus there's lots less setup...
and it even works with terence oordona's fixed header table css (http://imaputz.com/cssStuff/bigFourVersion.html;-)
which ffx handles fine, although iXploder's rendition is fugly:-( - Anth, on 10/12/2007, -0/+1I just wrote stuff to do this with XML, XSL and JS. Works very well in IE and FF, and supports paging and sorting.
- dergachev, on 10/12/2007, -0/+1huh?
- Pidooma, on 10/12/2007, -0/+1I spent some time at a previous job working on client-side table sorting. I was finally able to get a 400+ row table to sort in a fraction of the server round trip time. The best use of client-side sorting is when you support multi-column sort (stable sort + clicking on more than one column to sort by, say, date then size).
I learned some interesting things along the way. Most notably, that people always use toy examples to demonstrate their sorting code. Sorting is really only useful when you have more than a handful of data points! If you can see the entire table without using the scroll bar, you probably don't need dynamic sorting. One example I found was palpably slow with a dataset of only 10 rows, and it went downhill rapidly from there. This one is better than many I've seen, but the example data could be much bigger. - dergachev, on 10/12/2007, -0/+1a little googling produces "Mininova.org - torrent category hider and sorter"
http://userscripts.org/scripts/show/2138 - ReiToei, on 10/12/2007, -1/+1Wow, that's actually pretty neat!
- TheCheeta, on 10/12/2007, -1/+1ASP.NET - data access with n-Tier, auto-sorting and paging. Very little code. 'Nuff said.
- PhogHawk, on 10/12/2007, -2/+2Someone made a GreaseMonkey script for MiniNova.org using this technology I believe. It's wonderful.
- tainted, on 10/12/2007, -0/+0dave_colorado: can you show me as well? i need to display 500+ rows of data as well as dynamically inserting and deleting rows!
- friedcell, on 10/12/2007, -0/+0the code has been updated a bit. errors fixed, samples include a bigger table, added support for dataislands... http://friedcellcollective.net/outbreak/jssortedtable/
- rew222, on 10/12/2007, -0/+0I'm getting the same error on the description column in IE6 as grim. Also, I tried it with an xml data island and it only see one row. Not sure how to use it with data binding. Would also be interested in Dave_colorado's solution.
- al4444, on 10/12/2007, -0/+0strange js errors, when sorting
- wald, on 10/12/2007, -0/+0http://www.kryogenix.org/code/browser/sorttable/
- dacracot, on 10/12/2007, -0/+0I think there is a bug in the code... If the values in the column are mixed, as in strings and numbers, the sort does not work. I marked them as string hoping that the numeric values would be treated as strings. All strings is ok and all numbers is ok, but you can't mix. I can't predict when say part numbers will be strings, abc123, or numbers, 654332, so how to make this work?
-
Show 51 - 64 of 64 discussions



What is Digg?