在鼠标单击jquery上获取表部分的值

时间:2017-02-22 10:33:50

标签: jquery draggable droppable

我有一个可拖动的div部分,点击它时应该遍历页面的droppable部分中的所有指定行。如果可拖动值与行中的值相同,则使该区域不可删除。

这是我到目前为止所尝试的:

$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');
    //}
  });
});

请告诉我是否应提供更多详情,例如html .. thx

0 个答案:

没有答案