javascript - DataTable jquery selectors not firing -


I have code to handle clicks on line or individual cells.

  $ (document) .REDE (function () {var JSON_URL = '{% url} technician_activity "%}'; var oTable = $ ('# technician_activity'). DataTable ({" True "server side": true, "Ajax" ": JSON_URL," jQueryUI ": true}); Warning (" Do not work without this alert selectors? OTable = "+ oTable); oTable $ ('Tr'). Click (function () {var data = oTable .fnGetData (this); Alert ("Column" + Data);}); oTable. $ ('Td') (function () {Var data = oTable.fnGetData (this); Alert ("cell" + data);});});  

One thing that I like is without the first warning statement

  Warning ("Do not work without the warning selectors? OTable =" + OTable);  

The tr and td selectors do not work. It is very amazed for me - is this the difference that is doing this warning?

Now I am using the suggested code here -

But it is still a question that why I initially posted, the first warning () works with the statement but they do not work when this warning statement is absent ....

Curiosity Just want to understand what is happening in the case of someone's thoughts. / P>


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -