Re: [jQuery] Re: sorting columns using jquery. noob with html and java. built custom php using snmp
Alex, Thanks so much. It does look a lot better...and looking through your changes, it makes perfect sense. Thanks for doing that. Are you sure this code belongs in my .php file or should it be in the jquery.tablesorter.min.js file? $(document).ready(function() { // call the tablesorter plugin $(#results_table).tablesorter({ // enable debug mode debug: true }); });/script On Tue, Dec 29, 2009 at 5:08 AM, Alex Mcauley webmas...@thecarmarketplace.com wrote: You have alot of unclosed tags in there ... Let me help you out a bit and pastebin how it should look!... This should help http://pastie.org/759936 On Dec 28, 6:44 pm, ace123 markay...@gmail.com wrote: I'm not sure if this is possible...but I love the jquery tablesorter- but I can't figure out how to get it working. My page displays as if it's not even there. I used php to snmpget some data from my network switches and routers. It saves it to my DB...then I have this page to display the information from the database. This is where I want to be able to sort, by switch type, software version, etc. I'm not a code guy, just a network engineer trying to make my job easier. Your help please is MUCH appreciated. I've been trying to get this to work off and on for 6 months. This is what I've got so far The page looks something like this when I load it. Host Name Device Type Firmware VersionSoftware Version edge-109c-gs.gov.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-241c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-399c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 html body ?php $username=root; $password=; $database=switchesdb; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM switchcode; $result=mysql_query($query); $num=mysql_numrows($result); ? head script type=text/javascript src=/var/www/html/jquery-1.3.2.js/ script script type=text/javascript src=/var/www/html/ jquery.tablesorter.min.js/script script type=text/javascript $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ // enable debug mode debug: true }); });/script table id=table table class=tablesorter cellspacing=1 thead table border=1 cellspacing=4 cellpadding=4 tr thfont face=Arial, Helvetica, sans-serifHost Name/font/th thfont face=Arial, Helvetica, sans-serifDevice Type/font/th thfont face=Arial, Helvetica, sans-serifFirmware Version/font/ th thfont face=Arial, Helvetica, sans-serifSoftware Version/font/ th /tr /thead /head ?php $i=0; while ($i $num) { $host_name=mysql_result($result,$i,host_name); $device_type=mysql_result($result,$i,device_type); $firmware_version=mysql_result($result,$i,firmware_version); $software_version=mysql_result($result,$i,software_version); ? tbody tr tdfont face=Arial, Helvetica, sans-serif?php echo $host_name; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php echo $device_type; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring =strstr($firmware_version, \); echo ($cleanstring); ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring1 =strstr($software_version, \); echo ($cleanstring1); ?/font/td /tr /tbody /body /html ?php $i++;} ? -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS.
Re: [jQuery] Re: sorting columns using jquery. noob with html and java. built custom php using snmp
Thanks for that awesome explanation. I just asked because the data isn't sortable. But it's very nice looking... When I click Host Name or Device Type, it just highlights it. I guess I was just hoping jquery would figure it out, and make those columns sortable. I assume I need to some how tell it to. Host Name Device Type Firmware Version Software Version edge-109c-gs.gov.ntwk470-24T3.6.0.7v3.7.3.13edge-241c-gs.anx.ntwk470-24T 3.6.0.7v3.7.3.13edge-399c-gs.anx.ntwk470-24T3.6.0.7v3.7.3.13 edge-1c-cr.ngc.ntwk5510-48T5.0.0.4v5.1.0.015 On Tue, Dec 29, 2009 at 8:54 AM, brian zijn.digi...@gmail.com wrote: Leave it in the PHP file. The tablesorter file should be left clean. Think of it as a library that you include. The snippet of code you referred to is something that makes use of that library. Don't be fooled by the script tags. While the file is a PHP script, any PHP code is parsed on the server. The script tags, however, are parsed by the browser's JS engine, and are unrelated to PHP. On Tue, Dec 29, 2009 at 11:25 AM, Mark K. Ayler Jr. markay...@gmail.com wrote: Alex, Thanks so much. It does look a lot better...and looking through your changes, it makes perfect sense. Thanks for doing that. Are you sure this code belongs in my .php file or should it be in the jquery.tablesorter.min.js file? $(document).ready(function() { // call the tablesorter plugin $(#results_table).tablesorter({ // enable debug mode debug: true }); });/script On Tue, Dec 29, 2009 at 5:08 AM, Alex Mcauley webmas...@thecarmarketplace.com wrote: You have alot of unclosed tags in there ... Let me help you out a bit and pastebin how it should look!... This should help http://pastie.org/759936 On Dec 28, 6:44 pm, ace123 markay...@gmail.com wrote: I'm not sure if this is possible...but I love the jquery tablesorter- but I can't figure out how to get it working. My page displays as if it's not even there. I used php to snmpget some data from my network switches and routers. It saves it to my DB...then I have this page to display the information from the database. This is where I want to be able to sort, by switch type, software version, etc. I'm not a code guy, just a network engineer trying to make my job easier. Your help please is MUCH appreciated. I've been trying to get this to work off and on for 6 months. This is what I've got so far The page looks something like this when I load it. Host Name Device Type Firmware VersionSoftware Version edge-109c-gs.gov.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-241c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-399c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 html body ?php $username=root; $password=; $database=switchesdb; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM switchcode; $result=mysql_query($query); $num=mysql_numrows($result); ? head script type=text/javascript src=/var/www/html/jquery-1.3.2.js/ script script type=text/javascript src=/var/www/html/ jquery.tablesorter.min.js/script script type=text/javascript $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ // enable debug mode debug: true }); });/script table id=table table class=tablesorter cellspacing=1 thead table border=1 cellspacing=4 cellpadding=4 tr thfont face=Arial, Helvetica, sans-serifHost Name/font/th thfont face=Arial, Helvetica, sans-serifDevice Type/font/th thfont face=Arial, Helvetica, sans-serifFirmware Version/font/ th thfont face=Arial, Helvetica, sans-serifSoftware Version/font/ th /tr /thead /head ?php $i=0; while ($i $num) { $host_name=mysql_result($result,$i,host_name); $device_type=mysql_result($result,$i,device_type); $firmware_version=mysql_result($result,$i,firmware_version); $software_version=mysql_result($result,$i,software_version); ? tbody tr tdfont face=Arial, Helvetica, sans-serif?php echo $host_name; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php echo $device_type; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring =strstr($firmware_version, \); echo ($cleanstring); ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring1 =strstr($software_version, \); echo ($cleanstring1); ?/font/td /tr /tbody /body /html ?php $i++;} ? -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS. -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS.
[jQuery] maskedinput plugin not cooperating with validate plugin?
My project uses jquery.maskedinput.js 1.2.2 and jquery.validate.js r6096. I'm looking at a date field, with a mask of 99/99/, which happens to also be required. If I focus and then blur on the required date field, validate fires (as it should), and does its required check, which (if I'm reading this properly) consists of a length check on the date textfield. Problem is, the 'value' of the date textfield is the format mask text itself, '__/__/', with a length of 10, so validation passes. Is there a prescribed way (short of my hacking jquery.validate.js) for validate and maskedinput to play nicely together? Say, for validate to return false if the required field's value matches the mask applied to it? I'm trying to use maskedinput's completed:function() to test and zap the data, but it's not firing properly just yet. Thanks much for any help / clarification / workarounds! Mark