Created
October 31, 2012 16:40
-
-
Save optikalefx/3988161 to your computer and use it in GitHub Desktop.
Open JS Grid Drop Downs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// require our class | |
require_once("grid.php"); | |
// load our grid with a table | |
$grid = new Grid("tutorials", array( | |
"save"=>true, | |
"select" => 'selectFunction' | |
)); | |
// if you have anonymous function support in PHP (5.3.2+) Then you can just write the | |
// Function above instead of creating a separate one here. | |
function selectFunction($grid) { | |
$selects = array(); | |
// category select | |
$grid->table = "categories"; | |
$selects["CategoryID"] = $grid->makeSelect("CategoryID","Name"); | |
// active select | |
$selects["active"] = array("1"=>"true","0"=>"false"); | |
// render data | |
$grid->render($selects); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(function() { | |
$(".users").grid({ | |
editing:true | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="demo demo4" action="ajax2.php"> | |
<tr> | |
<th col="Title">Title</th> | |
<th col="CategoryID" width="250" type="select">Drop down from another table</th> | |
<th col="active" width="200" type="select">Hardcoded drop down</th> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment