-2

I have two tables inside contenteditable div. I applied selectable class to first table. My problem is, I can insert text in second table but can not insert text in first table.

https://jsfiddle.net/waou22dp/8/

Anthon
  • 69,918
  • 32
  • 186
  • 246
Prashant16
  • 1,514
  • 3
  • 18
  • 39

1 Answers1

0

The problem might be due to the version of jquery you were referring.

You were referring jquery-1.8.3.js and jquery-ui-1.9.2.js which might have caused incompatibility with the versions and in the console I was able to see .selectable function was undefined and an Uncaught TypeError: $(...).selectable is not a function error. Now I just changed the jquery version to jquery-2.0.2.js and jquery-ui-1.10.3.js` and that actually is compatible!!

Check this Updated Fiddle

UPDATE:

I don't think it's possible!! because you are trying to override an event where both cannot occur at a time!! I tried applying below method, but even that will not be useful many times. Having said that it will be working, I mean click happens and it becomes editable only after multiple consecutive clicks:

$(document).ready(function(){
   $('#tbl1').selectable({
        filter: "td"
    }).on('click',function(){
        $(this).attr('contenteditable','true');
    });
});

Here is the Fiddle

Guruprasad J Rao
  • 29,410
  • 14
  • 101
  • 200