我目前正在我的 MySQL 数据库上运行 Sequelize.js 代码,这是使用迁移创建的。我有一张表格,上面有这样定义的人:
return queryInterface.createTable('Persons', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
unique: true,
type: Sequelize.INTEGER
},
email: {
allowNull: false,
unique: true,
type: Sequelize.STRING
},
firstName: {
type: Sequelize.STRING
},
lastName: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
Run Code Online (Sandbox Code Playgroud)
结果表如下所示:
`Persons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`firstName` varchar(255) DEFAULT NULL,
`lastName` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` …
Run Code Online (Sandbox Code Playgroud) 我正在使用DataTables列出我的Web应用程序的每个页面上显示的"事件".
对于每个页面,我都有一个列,每个事件都是一行,每页都有一个复选框.(为了让您了解它的样子:http://i.stack.imgur.com/6QhsJ.png)
当我点击一个页面时,它应该检查所有复选框,但是只在DataTable的当前页面上选中复选框.
任何帮助表示赞赏!
编辑:这是我的问题的JSFiddle(https://jsfiddle.net/2n3dyLhh/2/)
HTML
<table id="eventsTable" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Checkbox<input type="checkbox" id="checkall"/></th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td><input type="checkbox" id="checkbox1"/></td>
</tr>
<tr>
<td>Garrett Winters</td>
<td><input type="checkbox" id="checkbox2"/></td>
</tr>
<tr>
<td>Ashton Cox</td>
<td><input type="checkbox" id="checkbox3"/></td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td><input type="checkbox" id="checkbox4"/></td>
</tr>
<tr>
<td>Airi Satou</td>
<td><input type="checkbox" id="checkbox5"/></td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td><input type="checkbox" id="checkbox6"/></td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td><input type="checkbox" id="checkbox7"/></td>
</tr>
<tr>
<td>Rhona …
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个包含输入组的表单.我使用'col'-class of bootstrap来设置它的样式,但是当它与'input-group'类结合使用时,列的填充将被删除.
我想将日期和名称输入字段对齐.
这是我的JSFiddle
HTML
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 col-xs-2 control-label">Date</label>
<div class="col-sm-4 col-xs-4 input-group">
<input type="text" class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-xs-2 control-label">Name</label>
<div class="col-sm-4 col-xs-4">
<input type="text" class="form-control" />
</div>
</div>
</div>
<br><br>
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 col-xs-2 control-label">Date</label>
<div class="col-sm-4 col-xs-4">
<input type="text" class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-xs-2 control-label">Name</label>
<div class="col-sm-4 col-xs-4"> …
Run Code Online (Sandbox Code Playgroud)