EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: bbones on September 04, 2015, 04:06:07 AM



Title: Requirejs vs data-options, on-click etc.
Post by: bbones on September 04, 2015, 04:06:07 AM
When I use in Requirejs module productType.js something like

Code:
$("#spa-cntr").panel({
href : '/xxx/forms/productType.html',
onLoad : function() {}
});

I can't write in productType.html nothing like
Code:
<div data-options="iconCls:'icon-add'" onclick="productType.newNode()">New
Node</div>
Error in Chrome looks like
Quote
Uncaught ReferenceError: productType is not defined
I think because parser doesn't put execution of js code there in scope of module.

Everything works fine with
Code:
 $('#btn').bind('click', newNode());

or putting module itself in global context
Code:
window.productType = this;
but is there another way to work with isolated in module functions in html?