我有一个可拖动的表,我正试图为它拖动一个tr,我想把它放到其中一个可拖放的表中。代码按预期工作,但我想使此代码成为动态代码。这怎么可能呢?以下是我的代码
jQuery('#pipeline_lead_card_table_1').droppable({
tolerance: 'pointer',
drop: function(event, ui) {
jQuery('#pipeline_lead_card_table_1 .pipeline_lead_card_table
tbody').append(ui.helper.children());
}
});
jQuery('#pipeline_lead_card_table_2').droppable({
tolerance: 'pointer',
drop: function(event, ui) {
jQuery('#pipeline_lead_card_table_2 .pipeline_lead_card_table
tbody').append(ui.helper.children());
}
});
jQuery('#pipeline_lead_card_table_3').droppable({
tolerance: 'pointer',
drop: function(event, ui) {
jQuery('#pipeline_lead_card_table_3 .pipeline_lead_card_table
body').append(ui.helper.children());
}
});
jQuery('#pipeline_lead_card_table_4').droppable({
tolerance: 'pointer',
drop: function(event, ui) {
jQuery('#pipeline_lead_card_table_4 .pipeline_lead_card_table
tbody').append(ui.helper.children());
}
});
我想让这段代码动态化,因为我不知道会动态生成多少个表。
https://stackoverflow.com/questions/51540584
复制相似问题