这是用于添加列的代码.
mDb.execSQL("ALTER TABLE " + table_name +
" ADD COLUMN " + column_name + " text");
Run Code Online (Sandbox Code Playgroud)
我的问题是在表的最后位置创建列.
Column1|Column2|Column3|Column4|Column5|NewAddedColumn6
Run Code Online (Sandbox Code Playgroud)
例如,是否可以在Column3和之间添加一列Column4?
Column1|Column2|Column3|NewAddedColumn6|Column4|Column5
Run Code Online (Sandbox Code Playgroud) 哦,男孩,哦,男孩
我想 和angularjs一起使用这个插件 http://www.jqueryscript.net/other/Simple-jQuery-Star-Rating-System-For-Bootstrap-3.html.
只要我第一次加载页面时使用的是JSON,它就可以正常工作了.当我修改或甚至只是添加元素到数组时,星系统不再工作.到目前为止我花了很多时间来检测错误,但我无法解决.
这是我推新元素时的样子.

当我查看google chrome元素时,我发现新生成的Star Ratings缺少一堆代码.
第一次加载页面时生成
<div class="star-rating rating-md rating-active"><div class="clear-rating clear-rating-active" title="Clear"><i class="glyphicon glyphicon-minus-sign"></i></div><div class="rating-container rating-gly-star" data-content="?????"><div class="rating-stars" data-content="?????" style="width: 142px;"></div><input value="4" type="number" class="rating form-control hide" min="0" max="5" step="0.5"></div><div class="caption"><span class="label label-primary">Four Stars</span></div></div>
Run Code Online (Sandbox Code Playgroud)
按下按钮以推送新元素后,新代码看起来像这样
<input value="4" type="number" class="rating" min="0" max="5" step="0.5">
Run Code Online (Sandbox Code Playgroud)
HTML代码
<div ng-repeat="x in allRecords" >
<input id="input-21d" value="4" type="number" class="rating" min=0 max=5 step=0.5 data-size="sm">
</div>
Run Code Online (Sandbox Code Playgroud)
控制器初始化
Edi:我的控制器和模块设置如下所示,如果你回答请考虑这个:)
var myApp = angular.module('myApp', ['ngAnimate'])
myApp.controller("ContactController", function ($scope, $sce, $http, $timeout) {
$scope.allRecords = [ …Run Code Online (Sandbox Code Playgroud) 我完全不知道这里可能出错了什么.
使用1.1.5版本,一切都完美无瑕.
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
升级到1.3.8螺丝我的整个应用程序.
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
获取此错误参数'ContactControllerHeading'不是函数,未定义
html的
<html ng-app="myApp" >
<body>
<div ng-controller="ContactControllerHeading">
...
lots of cool stuff here :)
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
.js文件
var myApp = angular.module('myApp', []);
function ContactControllerHeading($scope,$http) {
$scope.Home = function() {
...
lots of cool stuff :)
}
}
Run Code Online (Sandbox Code Playgroud)