Wednesday 15 January 2014

jQuery UI Draggable Dynamic Content -


I'm adding some dynamic content to my page while loading. I want to make the rows I dragable and want to first & lt; Td> inside & lt; Tr & gt; has been dragged. I have made the rows fit, but I am not getting the first value and I am thinking that this is because they are connecting dynamically.

jQuery -

  $ (document) .on ('click', '.draggableJob', function () {// draggable jobs $ (". DraggableJob") Draggable ({cursor: "move", cursorAt: {top: 25, left: 75}, helper: function {var name = $ (this) .fund ('TD'). First (). Val ( ); Return $ ("
");}});

HTML -

  socket.on ('loadtable', function table ("# tablebed"). $ ("& Lt; tr class =" draggableJob "& gt; & lt; td & gt; ; 'Table ["Name"] +' & lt; / td & gt; & lt; td & gt; 'Table ["Location"] +' & lt; / td & gt; & lt; td & gt; ; 'Table ["Path"] +' & lt; / td & gt; & lt; td & gt; '+ table ["Foobar"] +' & lt; / td & gt; & lt; td & gt; ; & Lt; a href = "#model" roll = "button" category = "BTN BTN-Success" Data-Toggle = "Model">    & Lt; Td> & Lt; Input type = "checkbox" & gt; & Lt; / Td> & Lt; / Tr & gt; '); });    

You can only val () for input elements You should use the html ()

so that you have the code:

  var name = $ (this) .find ( 'Td') first () html () .;    

No comments:

Post a Comment