Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test_terms_load() {
- $vocabulary = taxonomy_vocabulary_machine_name_load('test_vc');
- $tree = taxonomy_get_tree($vocabulary->vid);
- $ecf_data = '';
- $ecf_data .= '<div class="test-class"><table width="50%">';
- $ecf_data .= '<tr><th>Titles</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr>';
- foreach ($tree as $key => $term) {
- $ecf_data .= '<tr>';
- $ecf_data .= '<td>' . $term->name . '</td>';
- for($i=1; $i<=5; $i++) {
- $ecf_data .= '<td><input type="checkbox" name=' . $term->name . '-' . $i . '></td>';
- }
- $ecf_data .= '</tr>';
- }
- $ecf_data .= '</table></div>';
- print $ecf_data;
- }
- $("[class^='testing-']").click(function(e) {
- var nodeid = $(this).attr('id');
- alert(nodeid + ' - ' +Drupal.settings.basePath + Drupal.settings.pathPrefix );
- $.ajax({
- method: "POST",
- url: Drupal.settings.basePath + Drupal.settings.pathPrefix + "testing/ajax/"+nodeid,
- success: function(result){
- if(result.length > 0) {
- alert(result);
- $(result).appendTo(".course_titles");
- //$(".messages").html(result);
- }else {
- alert('empty');
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment