Tuesday, 15 July 2014

Getting index values from JQuery Ui, into a usable array -



Getting index values from JQuery Ui, into a usable array -

hi i'm using jquery ui selectable multiselect grid. cannot life of me figure out how values of index usable array/object. can have them display in div values, have tried them out of there , else no avail. have spent hours looking , have seen multiple people similar issue help appreciated.

<!doctype html> <html class="" xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"><head> <title>testing</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-language" content="en"> <meta name="language" content="en"> <link rel="stylesheet" href="css/phpmm.css"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery_002.js"></script> <link rel="stylesheet" href="ui/jquery.ui.all.css"> <link rel="stylesheet" href="ui/demos.css"> <script src="../jquery-1.8.3.js"></script> <script src="js/jquery.ui.core.js"></script> <script src="js/jquery.ui.widget.js"></script> <script src="js/jquery.ui.datepicker.js"></script> <script src="js/jquery.ui.position.js"></script> <script src="js/jquery.ui.menu.js"></script> <script src="js/jquery.ui.mouse.js"></script> <script src="js/jquery.ui.button.js"></script> <link rel="stylesheet" href="ui/dropdown.css"> <link rel="stylesheet" href="ui/multiclicklist.css"> <script src="js/jquery.ui.selectable.js"></script> <script src="js/jquery.dropkick-1.0.0.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="ui/dropkick.css" type="text/css"> <style> #testing { list-style-type: none; margin: 0; padding: .25em; width: 450px; height: 185px;} #testing li { margin: 3px; float: left; width: 100px; height: 80px; font-size: 1.5em; text-align: center; } </style> <script type ="text/javascript"> var apron = []; $(function() { $("#testing").bind("mousedown", function(e) { e.metakey = true; }).selectable(); }); $(function() { $( "#testing" ).selectable({ stop: function() { var result = $( "#click-result" ).empty(); $( ".ui-selected", ).each(function() { var pindex = $( "#testing li" ).index( ); result.append( ", " + ( pindex + 1 ) ); }); } }); }); (function showalert() { var wtf ="why dont work"; (var = 0; < apron.length; i++){ alert(apron[i]); }; }); </script> <body> <p id="feedback"> <span>you've selected:</span> <span id="click-result">none</span>. </p> <strong>&#149; select options? </strong> (select apply) <ol id="testing" class="multiclicklist"> <li class="ui-state-default"value="1">opt 1</li> <li class="ui-state-default"value="2">opt 2</li> <li class="ui-state-default"value="3">opt 3</li> <li class="ui-state-default"value="4">opt 4</li> <li class="ui-state-default"value="5">opt 5</li> <li class="ui-state-default"value="6">opt 6</li> <li class="ui-state-default"value="7">opt 7</li> <li class="ui-state-default"value="8">opt 8</li> </ol> <input type="button" value="checkvalue" onclick="showalert();"> </body> </html>

the code on tonyswoodshed.com doesn't work, i've set on jsfiddle.

is this: http://jsfiddle.net/wdd9w/1/ you're looking for?

jquery arrays user-interface selectable

No comments:

Post a Comment