Skip to content

Instantly share code, notes, and snippets.

@optikalefx
Last active October 12, 2015 06:58
Show Gist options
  • Save optikalefx/3988073 to your computer and use it in GitHub Desktop.
Save optikalefx/3988073 to your computer and use it in GitHub Desktop.
Open JS Grid Linking
<?php
// require our class
require_once("grid.php");
// load our grid with a table
$grid = new Grid("tutorials", array(
"joins"=>array(
"LEFT JOIN categories ON categories.CategoryID = tutorials.CategoryID"
),
"fields"=>array(
"thumb" => "CONCAT('http://cmivfx.com/images/thumbs/',ThumbnailLocation)",
"category"=>"categories.Name",
"price"=>"tutorials.Price"
)
));
?>
<script>
$(function(){
$(".demo3").grid({
editing: true
})
});
</script>
<table title="linking" class="demo demo3" action="ajax2.php">
<tr>
<th col="thumb" width="90" type="image" href="http://tny.com?q={{columns.Title}}">Image link</th>
<th col="DateCreated" href="http://tny.com?q={{columns.Title}}">Link other column</th>
<th col="Title" href="http://tny.com?q={{value}}">Link this column</th>
<th col="category" href="http://tny.com?q={{columns.price}}">Link other field</th>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment