EasyUI Forum
May 15, 2024, 05:19:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Requirejs vs data-options, on-click etc.  (Read 4562 times)
bbones
Newbie
*
Posts: 11


View Profile Email
« 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?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!