in start.php
$plugin_path = elgg_get_plugins_path();
$base = $plugin_path . 'custom_modules/actions/';
// action ajax page
elgg_register_action("custom_modules/assign_assessment_type", "$base/assign_assessment_type.php");
//add below code in view
$("#assessment_type").click(function(){
var steps = 1;
var mod_id = 10;
elgg.action('custom_modules/assign_assessment_type', {
data: { mod_id: mod_id,steps_id:steps},
success: function(json) {
//alert(json);
}
});
});
});
https://elgg.org/discussion/view/2520958/how-to-add-an-ajax-action
ReplyDelete