General developer forum

Using JQueryUi functions

 
Picture of Mohammad Eftekhari
Using JQueryUi functions
 

Hi.

I don't know how to use JQueryUI functions using AMD! I want to make a div Resizable but i don't know how to do that in moodle. This is what I have been testing  :


define(['jquery','jqueryui'],
function($, jqui) { //loads dependencies
var functions = {

init : function() {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! None of this works !!!!!!!!!!!!!!!!!!!!!!!!!
$("#leftside").ui.resizable();
$.ui("#leftside").resizable();
$("#leftsize").resizable();
}

};
return functions;
});
 
Average of ratings: -
Picture of Mohammad Eftekhari
Re: Using JQueryUi functions
 

There is a typo : the third one is "#leftside" like others 

 
Average of ratings: -
Picture of Mohammad Eftekhari
Re: Using JQueryUi functions
 

Found the solution.

define(['jquery','jqueryui'],
function($, jqui) { //loads dependencies
var functions = {
init : function() {
$("#leftside").resizable();
}
};
return functions;
});


The third one was correct as it should be. The problem was something else.

When "jquery-ui.css" is not included the resizable function doesn't work. Make sure Moodle or You have included this file. "$PAGE->requires->css..."

 
Average of ratings: -