0

I am using bootstrap at http://communitychessclub.com/games.php -it's a table that displays records of chess games. I want a row to be clickable like:

<?php 
echo "<tr onclick=\"location.href='basic.php?game=$game'\" >"; 
?>

The trouble is that the code to load and display the json table data doesn't include "TR" for displaying data; it's simply this:

<table data-toggle="table" data-url="games.json" data-cache="false" 
data-search="true" data-show-refresh="true" data-show-toggle="true" 
data-show-columns="true">

<thead>
<tr>

<th data-field="game" class="hidden-xs hidden-sm hidden-md 
hidden-lg">#</th>
        <th data-field="Date">Date</th>
        <th data-field="ECO">ECO</th>
        <th data-field="Event">Event</th>
        <th data-field="WhiteElo">Rat.</th>
        <th data-field="White">White</th>
        <th data-field="BlackElo" >Rat.</th>
        <th data-field="Black">Black</th>
    </tr>
</thead>

</table>

I want to grab the game number (data-field="game") and

<?php 
echo "<tr onclick=\"location.href='basic.php?game=$game'\" >"; 
?>

How could I proceed?

verlager
  • 794
  • 5
  • 25
  • 43
  • I answer your question and I deleted it after checking out your source code in the link .. I am sorry – Aviz May 03 '15 at 00:28
  • Can you not use ajax to call the json file, parse it and build a table with it. – Aviz May 03 '15 at 00:28
  • It's parsed automatically... I could do it if had the syntax, but how to access data-field="game" and write a js inline script in to make the row genuinely clickable? – verlager May 03 '15 at 00:43
  • Parsing Automatically seems to be the problem – Aviz May 03 '15 at 00:44
  • This may help http://stackoverflow.com/questions/10002704/how-do-i-make-bootstrap-table-rows-clickable – Aviz May 03 '15 at 00:49

0 Answers0