I would like to do popups on my first webpage which using a backbone.
define(['jquery',
'jqueryui',
'underscore',
'backbone',
'api',
'text!' + versions.getVersionedPath('templates/form.html')
function ($, jqueryui, _, Backbone, Api, Form) {
var widok = Backbone.View.extend({
formularz: _.template(Form),
el: 'body',
events: {
'click #test': 'test',
'click .del': 'usun',
'click #elo': 'test2'
},
initialize: function () {
this.$el.html(this.formularz());
self = this;
console.log('This model has been initialized.');
this.render();
},
render: function () {
console.log('Showing up');
this.$el.html(this.formularz());
},
test: function () {
self.showNews();
return false;
},
test2: function () {
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Delete all items": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
});
return {initialize: function () {
console.log('Initialize');
new widok;
self.showNews();
console.log('blablablablabla');
}};
});
I have function like this, but when I'm trying to use it I had error like
Uncaught TypeError: $(...).dialog is not a function.
I have defined jquery and jqueryui. Someone could help me ?
Have it on requirejs config
shim: {
jqueryui: {
"deps": ['jquery']
},