当前位置: 动力学知识库 > 问答 > 编程问答 >

draggable - Getting values of table section on mouse click jquery

问题描述:

I have a div section which is draggable, when clicked it should go through all specified rows in the droppable section of the page. And if the draggable value is thesame as the value in the row, make the area not droppable.

this is what i've tried so far:

$j('.dragCell').on('click', function(e) {

var fin = $j(this).text().replace(/[\t\n]+/g, ' '); //draggable elem

$j('.zoneHeader').each(function(index) { //go through the droppable

var theHeader = $j('.zoneHeader')[index].val(); //droppable elemnt.. gives error: $j(...)[index].text is not a function

var theZoneHeader = $j('.zoneHeader')[index]; //However this returns a <td> elem as:

//<td class="dataCell zoneHeader" id="j_id0:j_id4:photoBlock:j_id8:col1:availabilityRows:0:j_id10" colspan="1">Sophie Antoniou [Z2]</td>

console.log(theHeader); //.find('.zoneHeader').html());

//if(theZoneHeader !== fin){

//get child of this(theZoneHeader) and make removeClass('droppable');

//}

});

});

分享给朋友:
您可能感兴趣的文章:
随机阅读: