Jquery 模态引导中的表格格式?
我可以在模式引导中创建表吗? 我在表格中创建了一行,表格中有一个预览行的按钮 这是我的jsJquery 模态引导中的表格格式?,jquery,twitter-bootstrap,twitter,Jquery,Twitter Bootstrap,Twitter,我可以在模式引导中创建表吗? 我在表格中创建了一行,表格中有一个预览行的按钮 这是我的js $('.btn-success').click(function(){ var address = []; $(this).closest('tr').find('td').not(':last').each(function() { var textval = $(this).text(); // this will be the text
$('.btn-success').click(function(){
var address = [];
$(this).closest('tr').find('td').not(':last').each(function() {
var textval = $(this).text(); // this will be the text of each <td>
address.push(textval);
});
var hasil = address.join('<br />');
$("#id_preview").html(hasil);
});
$('.btn success')。单击(函数(){
var地址=[];
$(this).closest('tr').find('td').not(':last').each(function(){
var textval=$(this).text();//这将是每个
地址推送(textval);
});
var hasil=address.join(“
”);
$(“#id_preview”).html(hasil);
});
“我的所有代码”的预览现在位于:
我想“打印”按钮将查看一行的信息。
所以,我使用js来获取它们
我的问题是,如何在模式引导中以表格格式显示行数据。现在,我可以抓住所有的
谢谢我刚刚准备好了这个,不确定这是不是你想要的。我在模态窗口中放置了一个表(包含数据),它工作得很好
启动演示模式
&时代;
情态标题
#
名字
姓
用户名
1.
做记号
奥托
@mdo
2.
雅各布
桑顿
@肥
3.
拉里
鸟
@推特
关
保存更改
类似于
JQUERY
$('.btn-success').click(function(e){
e.preventDefault();
var $this = $(this);
var $trData = $this.closest('tr').clone();
$trData.find('td:last').remove();
var $thData = $this.closest('table').find('thead').clone();
$thData.find('th:last').remove();
var $table = $('<table></table>');
$table.append($thData).append($trData);
$("#id_preview").html($table);
$('#myModal').modal('show');
});
$('.btn success')。单击(函数(e){
e、 预防默认值();
var$this=$(this);
var$trData=$this.close('tr').clone();
$trData.find('td:last').remove();
var$thData=$this.close('table').find('thead').clone();
$thData.find('th:last').remove();
变量$table=$('');
$table.append($thData).append($trData);
$(“#id_preview”).html($table);
$('myModal').modal('show');
});
注意:由于某些原因,
modal background
在演示小提琴中出现了一些z-index
问题。你能发布你的代码吗?你试过哪一个?我的库德在胡闹。链接在我上面的描述中,谢谢Cerlin Boss。你太棒了。但是,在我的情况下,为什么不删除行动专栏呢?感谢Cerlin Boss。你太棒了。但是,在我的例子中,为什么不删除action列呢?sry我已经更新了fiddle,但是忘记了更新代码段。将更新。。等一下。。
$('.btn-success').click(function(e){
e.preventDefault();
var $this = $(this);
var $trData = $this.closest('tr').clone();
$trData.find('td:last').remove();
var $thData = $this.closest('table').find('thead').clone();
$thData.find('th:last').remove();
var $table = $('<table></table>');
$table.append($thData).append($trData);
$("#id_preview").html($table);
$('#myModal').modal('show');
});