|
|
10 |
define("tool_lp/frameworks_datasource",["jquery","core/ajax","core/notification"],(function($,Ajax,Notification){return{list:function(contextId,options){var args={context:{contextid:contextId}};return $.extend(args,void 0===options?{}:options),Ajax.call([{methodname:"core_competency_list_competency_frameworks",args:args}])[0]},processResults:function(selector,results){var options=[];return $.each(results,(function(index,data){options.push({value:data.id,label:data.shortname+" "+data.idnumber})})),options},transport:function(selector,query,callback){var el=$(selector),contextId=el.data("contextid"),onlyVisible=el.data("onlyvisible");if(!contextId)throw new Error("The attribute data-contextid is required on "+selector);this.list(contextId,{query:query,onlyvisible:onlyVisible}).then(callback).catch(Notification.exception)}}}));
|