On Tue, 2010-07-13 at 14:32 +0200, [email protected] wrote: > From: Jan Provaznik <[email protected]> > > Replaced Datatables plugin with simpler HTML table because some > issues when JS is off. Major issue with Datatables is that it doesn't > degrades gracefully when JS is off and server-side pagination. > > Images and instances are now displayed by HTML table > (there is new helper 'paginated_table'), this table keeps > all common functions like sorting, paginating, searching and > code is cleaner. Works with JS on or off.
Possible issues I noticed: * Search box on images list works fine if you just type and wait, but if you type something quickly and hit 'enter' as would usually be expected in a search form, it brings you to unexpected places like 'add new instance'). The 'typing brings back results' behavior is fine for js, but it should also fall back so enter submits the form to the right place as well (this part should work with or without js). * Also, the js version should indicate in some way that it is searching. This could be as simple as adding some italic text 'Searching' in the table header right near where you type, so the user notices it. Another option would be a spinner somewhere (probably either above the table, or overlayed). * Not sure what the issue was in the behavior of the javascript 'check-all' function, it worked for me, but if you want to try another solution that looks clean and simple, take a look at http://briancray.com/2009/08/06/check-all-jquery-javascript/ I think you can get rid of the two functions and just bind an anonymous function to the checkbox on document.ready - you might need to alter his code a bit, as we dont have all those divs and fieldsets, but if you combine that general concept with http://api.jquery.com/checkbox-selector/ , I think you should end up with something pretty clean. If you have trouble, let me know, I can help if needed. * General note on the javascript/style. named functions like are in this patch are generally not considered good practice anymore, as they clutter the main namespace. Where possible, it is better to bind anonymous functions to elements (especially if the behavior is the same for many elements in different situations - this can also allow those things to go in application.js, so they are always available). Where that does not make sense and you want to explicitly attach behavior, the functions should be added to a named object, so in our case probably 'Aggregator' or 'Deltacloud' would make the most sense. Again, if this does not make sense, I can elaborate in chat and/or provide links with more information. * I am torn on how much to suggest revision on the js logic within these functions. I think for now, with the general feedback above, we can probably leave the logic as-is, but then revisit it in a subsequent patch to simplify it. I see a number of things (a lot around binding checkbox behavior) that could be written much more simply, but it might be easier if I just went through afterwards, and made some suggestions for update in the form of a patch, as it is rather hard to say 'just change this or that' in the more involved functions. * I feel like I am forgetting something I wanted to bring up after typing all that, but I have probably given you more than enough to think about with that diatribe above :) Things that worked nicely: * Pages operate (including sort) w/o javascript enabled. * List comes back immediately instead of having to wait for it to load after page. -j _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
