Replacing buttons with links or ajax #57


  • New
  • Enhancment
Open
Assigned to _ForgeUser4509640
  • _ForgeUser7661527 created this issue Oct 17, 2011

    What is the enhancement in mind? How should it look and feel?

    Since the list has to reload every time you buy something (you lose all your filters and page position), I'd love to be able to use middle mouse button to get results open in a different browser tab, thus leaving my tab intact. Thing is, that doesn't work with submit buttons. Actually, shift-clicking a button opens a separate window (in chrome) but the result is "Please enter a quantity greater than 0" for some reason. Replacing the button with an image with a link would probably make this all easier.
    Another (perfect) solution is to rewrite purchase.php script so it would only return a JSON-encoded set {result string, [updated auction item quantity, updated balance, what not - optional]}, do AJAX request when user click buy, and then update all neccessary stuff on the page.

    Please provide any additional information below.

    Better is the opposite of good.

  • _ForgeUser7661527 added the tags New Enhancment Oct 17, 2011
  • _ForgeUser2335225 posted a comment Oct 21, 2011

    Since Exote is using DataTables w/ jQuery, all he needs to do is modify 1 line in his index.php file. He needs to add "bStateSave": true, to his java in his header. Tested locally on my server and works like a charm.

    <Snippet from index.php>

    <link rel="stylesheet" type="text/css" href="css/<?php echo $cssFile?>.css" />
    		<script type="text/javascript" language="javascript" src="js/jquery.js"></script>
    		<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
    		<script type="text/javascript" charset="utf-8">
    			$(document).ready(function() {
    				oTable = $('#example').dataTable({
    					"bJQueryUI": true,
    					"bStateSave": true,
    					"sPaginationType": "full_numbers"
    				});
    			} );
    		</script>
    

    Hope this helps, I know I spent a while looking how to keep the searches persistent.

  • _ForgeUser7441696 posted a comment Oct 22, 2011

    @vampiricalmind: Go

    Thank you for this! <3

  • _ForgeUser4509640 posted a comment Oct 22, 2011

    Nice :) Will include this in main files :D


To post a comment, please login or register a new account.