如何在jQuery + jQuery Mobile的行中添加删除选项? [英] How to add delete option in row in jQuery +jQuery Mobile?

查看:68
本文介绍了如何在jQuery + jQuery Mobile的行中添加删除选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否请您告诉我如何在行中添加删除选项.我在按钮单击时生成了行.我想在行中添加按钮或图标,以便用户也可以删除该行? 你能告诉我我将如何实现这一目标吗?

can you please tell me how to add delete option in row.I generated row on button click .I want to add button or icon on row so that user can also delete that row ? can you please tell me how i will achieve that ?

推荐答案

修改了小提琴: http://jsfiddle .net/R2DzV/28/

添加了删除按钮html:

Added remove button html:

'<a data-role="button" data-mini="true" data-theme="a" class="remove">Remove</a>' +

然后单击处理程序:

.on('click', '.remove', function(){
        $(this).closest('.ui-collapsible').closest('li').remove();
    });

这篇关于如何在jQuery + jQuery Mobile的行中添加删除选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆