0

I'm wrapping jqte inside an object,

com.comapany.app.domElement.RtfEditor = function(inputElementId) {

    // I've also tried .bind('click', function() {}
    $('#'+inputElementId).bind('click', null, function() {
        alert('binding under construction');
    });
    
    $('#'+inputElementId).jqte();
};

I'm creating an instance of this in another JS file like this

jqEditor = new com.comapany.app.domElement.RtfEditor('testEditor');

Problems, I'm facing:
I am able to either create a jquery text editor using jqte or bind click (or any) event, but not both at the same time. Please help!

Community
  • 1
  • 1
masT
  • 804
  • 4
  • 14
  • 29
  • Have you tried to bind your click event *after* initialising jqte, as it probably steals the click itself. The alternative would be using the deferred version of `on`, applied to document, to register your click event. If you can post a JSFiddle, happy to try create a working example. – iCollect.it Ltd Jan 09 '14 at 11:37
  • @TrueBlueAussie, yes I've tried that too sir. I also tried to expose a prototype method but also doesn't work. I've also inspected that jqte doesn't bind click event. – masT Jan 09 '14 at 12:01
  • How about that JSFiddle? Save on guess-work. – iCollect.it Ltd Jan 09 '14 at 12:07
  • I'm using JSFiddle first time, so please manage with this http://jsfiddle.net/5uLsn/1/ – masT Jan 09 '14 at 12:18
  • Ah, you need to add any external JavaScript includes to JSFiddle (e.g. the JavaScript file for rtfEditor). You add them under `external resources`, but the files must be somewhere you can access them publicly on the web (so that JSFiddle can see them). – iCollect.it Ltd Jan 09 '14 at 12:44

0 Answers0