jQuery DataTable button 5C

用DataTable自定义button时,一开始dom:“lBtrip” ,text输入了内容, 当把dom改成“Btrlip”,也就是想表格上方只显示一个button,其余的都放下方,这时发现button按钮变小了,text不显示了。 求问有遇到过类似情况的吗?分享下经验

1个回答

建议不要用datatables的按钮啥的,只用分页的就可以了,其他都不要显示了

qq_37688370
Paulant 回复愿意终身奋斗的小强: 可是需要用按钮实现功能,而且这个项目是以前别人写的,想改的幅度大一点也不太实际
大约 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
jQuery的datatable更新问题
function getProvince() { var province=document.getElementById("selProvince").value; $('#buchongList').dataTable().fnClearTable(); $.ajax({ type: "post", url: "/IotCloud-bugtrapper-service/rest/dynamic/listDynamicData", datatype: "json", data: { "time_type":"0", "filter_province":"10" }, success: function (data) { info = data.data; table = $('#buchongList').DataTable({ "filter": [ 6, false ], "bPaginate": true, "pagingType": "full_numbers", "bFilter": true, "bLengthChange": true, "bDestroy":true, "bInfo": true, "bSort": true, "retrieve":true, "oLanguage": { "sZeroRecords": "没有数据", "oPaginate": { "sFirst": "首页", "sPrevious": "前一页", "sNext": "后一页", "sLast": "尾页" } }, "columnDefs": [ { "targets": [12], "defaultContent": "<button id='shuju' style='cursor:pointer;color:#009ACD; margin-left:20px; background-color:transparent;border:none;outline:none;'><img src='img/icon2.png'></button>" + "<button id='download' style='cursor:pointer;color:#009ACD; margin-left:0px; background-color:transparent;border:none;outline:none;'><img src='img/icon1.png'></button>"+ "<button id='reset' style='cursor:pointer;color:#009ACD; margin-left:0px; background-color:transparent;border:none;outline:none;'><img src='img/icon3.png'></button>" }, {"orderable":false,"targets":[3,4,5] }, {"targets": [ 0 ], "visible": false}, ], data:info, columns: [ {data: ''}, {data: 'gatewayId'}, {data: "trapperUnitId"}, {data: 'trapperName'}, {data: 'locationName'}, {data: 'trapperAddr'}, {data: 'temp'}, {data: 'humidity'}, {data: 'windSpeed'}, {data: 'lightSource'}, {data: 'rainfall'}, {data: 'bugCount'} ] }); } }) } 要实现table更新。我先clear了表格,然后却加载不出数据了?求大神解释,谢谢。
Jquery的DataTable可以从缓存里面绑定数据吗?
that.WarrantyStatusEditCtrl = function($scope, $compile, $routeParams, $location, $log, apiService, columns, cacheService, commonUtils, DT_OPTION, WARRANTY_HEADER, $rootScope) { $scope.header = WARRANTY_HEADER.STATUS_EDIT; $scope.base = base; var updateObj = {}; var columnDefs = []; var currentStatus = $routeParams.status.substr(1); // 隐藏データチエツクコメント、操作 if (currentStatus === "4" || currentStatus === "5") { columnDefs = [{ "targets": [5], "visible": false, "searchable": false }, { "targets": [6], "visible": false, "searchable": false }]; } // Show【FJ納品手続き】Button if (currentStatus === "3") { $scope.showScheduleBtn = true; } $scope.queryParams = cacheService.cache('tstp.queryParams'); $scope.queryParams.ngFlg = [currentStatus]; $scope.queryParams.tscd = $routeParams.tscd; $scope.queryParams.tpcd = $routeParams.tpcd; var jumpFromCtrl = $rootScope.oldRoute.substr($rootScope.oldRoute.length - 12) ==='/edit/fillin'; if (jumpFromCtrl === false) { $scope.table = $('#dtList').DataTable($.extend({}, DT_OPTION, { // IF14102: 保証作業費請求状況の確認 ajax: apiService.dtAjax("/getRepairDetailInfo", $scope.queryParams, 'e.queryParams', function(data, info) { if (info) { $scope.tsnm = info.tsnm; $scope.tpnm = info.tpnm; cacheService.cache("tstp", { tscd: $routeParams.tscd, tpcd: $routeParams.tpcd, tsnm: $scope.tsnm, tpnm: $scope.tpnm }); } $scope.$apply(); cacheService.cache('warrantyCache.data', data); return data; }), columns: columns.warrantyStatusEdit('/warranty'), columnDefs: columnDefs, createdRow: function(row, data, index) { $compile(angular.element(row).contents())($scope); var selector = $(row).find('select').val(data.ngFlg); var input = $(row).find('input'); if (updateObj[data.mrNo]) { data = updateObj[data.mrNo]; var ngFlg = data.ngFlg; selector.val(ngFlg); if (ngFlg === "2") { input.val(data.ngRiyu); } } if (data.ngFlg !== "2") { input.prop("disabled", true).addClass("readonly"); } selector.on('change', function() { var selectVal = selector.val(); if (selectVal === "2") { input.prop("disabled", false).removeClass("readonly"); } else { input.prop("disabled", true).addClass("readonly"); input.val(""); data.ngRiyu = ""; } if (selectVal !== currentStatus || selectVal === "2") { data.ngFlg = selectVal; updateObj[data.mrNo] = data; } else if (selectVal === currentStatus) { delete updateObj[data.mrNo]; } groupObj(updateObj); }); input.on('change', function() { data.ngRiyu = input.val(); updateObj[data.mrNo] = data; groupObj(updateObj) }); var checkBtn = $(".check button", row); checkBtn.on('click', function() { cacheService.cache('warrantyCache.warranty', data); $location.path("/warranty/" + data.mrNo + "/check"); $scope.$apply(); }); $scope.$apply(); } })); } else { readCache(); } columns: columns.warrantyStatusEdit('/warranty'),//模板 readCache();//读取缓存里面的数据,我用的angularjs的双向绑定可以显示数据,但是工作量比较大模板判断比较多,所有请教下各位大神.
腾讯地图怎样在marker弹出的信息窗口添加点击事件? 请求大佬指教
### 在弹出的窗口在添加点击事件,搞了两小时没有头绪 vue项目 ![红框加点击事件](https://img-ask.csdn.net/upload/202003/23/1584957715_652542.jpg) ``` html代码 <div> <div id="container" style="width:900px;height:450px;"> </div> </div> ``` js代码,给模板中的button添加点击事件 ``` TMap().then(qq => { var center = new qq.maps.LatLng(31.697393, 117.083008) var map = new qq.maps.Map(document.getElementById('container'), { // 地图的中心地理坐标 center: center, // 初始化地图缩放级别 zoom: 15 }) var infoWin = new qq.maps.InfoWindow({ map: map }) var thih = this for (let i = 0; i < thih.datatable.length; i++) { var marker = new qq.maps.Marker({ position: new qq.maps.LatLng(thih.datatable[i].latitude, thih.datatable[i].longitude), map: map }) marker.id = thih.datatable[i].id qq.maps.event.addListener(marker, 'click', function () { console.log(thih.datatable[i]) infoWin.open() infoWin.setContent(`<div>${thih.datatable[i].address}{上班} <p>人数: ${thih.datatable[i].arriveTime} <button id='aa' style='color:red'>查看详情</button></p></div>`) // 提示窗位置 infoWin.setPosition(new qq.maps.LatLng(thih.datatable[i].latitude, thih.datatable[i].longitude)) }) } }) ```
这个datatable 的ajax 怎么写,麻烦大佬给填充一下
这里边的ajax请求不会写,麻烦大佬给填充一下 ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>二十九师信息</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> <script src="https://cdn.bootcss.com/datatables/1.10.16/js/jquery.dataTables.js"></script> <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> <style> .content { margin: 50px auto; border: 1px solid #ccc; } .operation { margin: 10px; } .operation>button { margin: 10px; } #books_length { float: left; margin-left: 20px; } #books_filter { float: right; margin-right: 20px; } #books { margin: 5px; text-align: center; } .center-block { display: block; width: 21%; margin: auto; } </style> </head> <body> <section class="content"> <div class="btn-group operation"> <button id="btn_add" type="button" class="btn bg-primary"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn bg-info"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-success"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除 </button> <button type="button" class="btn btn-primary" >导出Excel</button> </div> <!-- 添加模块 --> <div class="modal fade" id="addBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">添加信息</h4> </div> <div id="addBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="bookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="bookName" type="text"> </div> </div> <div class="form-group"> <label for="bookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="bookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="bookPrice" class="col-sm-2 control-label">家庭住址:*</label> <div class="col-sm-10"> <input class="form-control" id="bookPrice" type="text"> </div> </div> <div class="form-group"> <label for="bookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="bookPublish" type="text"> </div> </div> <div class="form-group"> <label for="bookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="bookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelAdd" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="addBooksInfo" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 修改模块 --> <div class="modal fade" id="editBookInfo" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">修改信息</h4> </div> <div id="editBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="editBookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="editBookName" type="text"> </div> </div> <div class="form-group"> <label for="editBookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="editBookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="editBookPrice" class="col-sm-2 control-label">家庭住址:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPrice" type="text"> </div> </div> <div class="form-group"> <label for="editBookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPublish" type="text"> </div> </div> <div class="form-group"> <label for="editBookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="editBookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelEdit" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="saveEdit" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 删除模块 --> <div class="modal fade" id="deleteBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">确认要删除吗?</h4> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="delete" type="button" class="btn btn-danger" data-dismiss="modal">删除</button> </div> </div> </div> </div> <!-- 页面view层 --> <table id="books" class="table table-striped table-bordered row-border hover order-column" cellspacing="0" width="100%"> <thead> <tr> <th>序号</th> <th>姓名</th> <th>性别</th> <th>家庭住址</th> <th>联系电话</th> <th>备注</th> </tr> </thead> <tbody></tbody> </table> </section> </body> <script> var data = [['', '李云龙', '男', '三八六旅', '133435435', '厉害']] var titles = ['','姓名', '性别', '家庭住址', '联系电话', '备注'] $(function () { var table = $('#books').DataTable({ data: data, "pagingType": "full_numbers", "bSort": true, "language": { "sProcessing": "处理中...", "sLengthMenu": "显示 _MENU_ 项结果", "sZeroRecords": "没有匹配结果", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoPostFix": "", "sSearch": "搜索:", "sUrl": "", "sEmptyTable": "表中数据为空", "sLoadingRecords": "载入中...", "sInfoThousands": ",", "oPaginate": { "sFirst": "首页", "sPrevious": "上页", "sNext": "下页", "sLast": "末页" }, "oAria": { "sSortAscending": ": 以升序排列此列", "sSortDescending": ": 以降序排列此列" } }, "buttons": [{ 'extend': 'excel', 'text': '导出为Excel统计表',//定义导出excel按钮的文字 'className': 'btn btn-primary', //按钮的class样式 'exportOptions': { 'modifier': { 'page': 'all' } } }], "columnDefs": [{ "searchable": true, "orderable": false, "targets": 0 }], "order": [[0, 'asc']], }); table.on('order.dt search.dt', function() { table.column(0, { search: 'applied', order: 'applied' }).nodes().each(function(cell, i) { cell.innerHTML = i + 1; }); }).draw(); $('#books tbody').on('click', 'tr', function () { if ( $(this).hasClass('selected') ) { $(this).removeClass('selected'); } else { table.$('tr.selected').removeClass('selected'); $(this).addClass('selected'); } }); $("#cancelAdd").on('click', function() { console.log('cancelAdd'); $("#addBookModal").find('input').val('') }) $("#addBooksInfo").on('click', function() { console.log('addBooksInfo'); if (data.length) { if ($("#addBookModal").find('input').val() !== '') { var bookbutton = $("#bookbutton").val() var bookName = $("#bookName").val() var bookAuthor = $("#bookAuthor").val() var bookPrice = $("#bookPrice").val() var bookPublish = $("#bookPublish").val() var bookISBN = $("#bookISBN").val() var addBookInfos = [].concat(bookName, bookAuthor, bookPrice, bookPublish, bookISBN); for (var i = 0; i < addBookInfos.length; i++) { if (addBookInfos[i] === '') { alert(titles[i] + '内容不能为空') } } table.row.add(['', bookName, bookAuthor, bookPrice, bookPublish, bookISBN]).draw(); $("#addBookModal").find('input').val('') } } else { alert('请输入内容') } }) $("#addBooksInfo").click(); $("#btn_add").click(function(){ console.log('add'); $("#addBook").modal() }); $('#btn_edit').click(function () { console.log('edit'); if (table.rows('.selected').data().length) { $("#editBookInfo").modal() var rowData = table.rows('.selected').data()[0]; var inputs = $("#editBookModal").find('input') for (var i = 0; i < inputs.length; i++) { $(inputs[i]).val(rowData[i + 1]) } } else { alert('请选择项目'); } }); $("#saveEdit").click(function() { var editBookName = $("#editBookName").val() var editBookAuthor = $("#editBookAuthor").val() var editBookPrice = $("#editBookPrice").val() var editBookPublish = $("#editBookPublish").val() var editBookISBN = $("#editBookISBN").val() var newRowData = [].concat(editBookName, editBookAuthor, editBookPrice, editBookPublish, editBookISBN); var tds = Array.prototype.slice.call($('.selected td')) for (var i = 0; i < newRowData.length; i++) { if (newRowData[i] !== '') { tds[i + 1].innerHTML = newRowData[i]; } else { alert(titles[i] + '内容不能为空') } } }) $("#cancelEdit").click(function() { console.log('cancelAdd'); $("#editBookModal").find('input').val('') }) $('#btn_delete').click(function () { if (table.rows('.selected').data().length) { $("#deleteBook").modal() } else { alert('请选择项目'); } }); $('#delete').click(function () { table.row('.selected').remove().draw(false); }); }) </script> </html> ```
datatable添加一行后怎么能够自动刷新页面
fnDraw()方法,删除的时候好使,添加的时候没有反应呢?jquery-validation 用button按钮提交的时候该怎么写。
在data最后一列加上删除和修改按钮,自己加了之后一直报数据项错误,麻烦大佬们帮下忙?
在data最后一列加上删除和修改按钮,自己加了之后一直报数据项错误,麻烦大佬帮下忙 ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>二十九师信息</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> <script src="https://cdn.bootcss.com/datatables/1.10.16/js/jquery.dataTables.js"></script> <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> <style> .content { margin: 50px auto; border: 1px solid #ccc; } .operation { margin: 10px; } .operation>button { margin: 10px; } #books_length { float: left; margin-left: 20px; } #books_filter { float: right; margin-right: 20px; } #books { margin: 5px; text-align: center; } .center-block { display: block; width: 21%; margin: auto; } </style> </head> <body> <section class="content"> <div class="btn-group operation"> <button id="btn_add" type="button" class="btn bg-primary"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn bg-info"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-success"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除 </button> <button type="button" class="btn btn-primary" >导出Excel</button> </div> <!-- 添加模块 --> <div class="modal fade" id="addBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">添加信息</h4> </div> <div id="addBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="bookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="bookName" type="text"> </div> </div> <div class="form-group"> <label for="bookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="bookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="bookPrice" class="col-sm-2 control-label">家庭住址:*</label> <div class="col-sm-10"> <input class="form-control" id="bookPrice" type="text"> </div> </div> <div class="form-group"> <label for="bookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="bookPublish" type="text"> </div> </div> <div class="form-group"> <label for="bookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="bookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelAdd" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="addBooksInfo" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 修改模块 --> <div class="modal fade" id="editBookInfo" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">修改信息</h4> </div> <div id="editBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="editBookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="editBookName" type="text"> </div> </div> <div class="form-group"> <label for="editBookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="editBookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="editBookPrice" class="col-sm-2 control-label">家庭住址:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPrice" type="text"> </div> </div> <div class="form-group"> <label for="editBookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPublish" type="text"> </div> </div> <div class="form-group"> <label for="editBookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="editBookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelEdit" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="saveEdit" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 删除模块 --> <div class="modal fade" id="deleteBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">确认要删除吗?</h4> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="delete" type="button" class="btn btn-danger" data-dismiss="modal">删除</button> </div> </div> </div> </div> <!-- 页面view层 --> <table id="books" class="table table-striped table-bordered row-border hover order-column" cellspacing="0" width="100%"> <thead> <tr> <th>序号</th> <th>姓名</th> <th>性别</th> <th>家庭住址</th> <th>联系电话</th> <th>备注</th> </tr> </thead> <tbody></tbody> </table> </section> </body> <script> var data = [['', '李云龙', '男', '三八六旅', '133435435', '厉害']] var titles = ['','姓名', '性别', '家庭住址', '联系电话', '备注'] $(function () { var table = $('#books').DataTable({ data: data, "pagingType": "full_numbers", "bSort": true, "language": { "sProcessing": "处理中...", "sLengthMenu": "显示 _MENU_ 项结果", "sZeroRecords": "没有匹配结果", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoPostFix": "", "sSearch": "搜索:", "sUrl": "", "sEmptyTable": "表中数据为空", "sLoadingRecords": "载入中...", "sInfoThousands": ",", "oPaginate": { "sFirst": "首页", "sPrevious": "上页", "sNext": "下页", "sLast": "末页" }, "oAria": { "sSortAscending": ": 以升序排列此列", "sSortDescending": ": 以降序排列此列" } }, "buttons": [{ 'extend': 'excel', 'text': '导出为Excel统计表',//定义导出excel按钮的文字 'className': 'btn btn-primary', //按钮的class样式 'exportOptions': { 'modifier': { 'page': 'all' } } }], "columnDefs": [{ "searchable": true, "orderable": false, "targets": 0 }], "order": [[0, 'asc']], }); table.on('order.dt search.dt', function() { table.column(0, { search: 'applied', order: 'applied' }).nodes().each(function(cell, i) { cell.innerHTML = i + 1; }); }).draw(); $('#books tbody').on('click', 'tr', function () { if ( $(this).hasClass('selected') ) { $(this).removeClass('selected'); } else { table.$('tr.selected').removeClass('selected'); $(this).addClass('selected'); } }); $("#cancelAdd").on('click', function() { console.log('cancelAdd'); $("#addBookModal").find('input').val('') }) $("#addBooksInfo").on('click', function() { console.log('addBooksInfo'); if (data.length) { if ($("#addBookModal").find('input').val() !== '') { var bookbutton = $("#bookbutton").val() var bookName = $("#bookName").val() var bookAuthor = $("#bookAuthor").val() var bookPrice = $("#bookPrice").val() var bookPublish = $("#bookPublish").val() var bookISBN = $("#bookISBN").val() var addBookInfos = [].concat(bookName, bookAuthor, bookPrice, bookPublish, bookISBN); for (var i = 0; i < addBookInfos.length; i++) { if (addBookInfos[i] === '') { alert(titles[i] + '内容不能为空') } } table.row.add(['', bookName, bookAuthor, bookPrice, bookPublish, bookISBN]).draw(); $("#addBookModal").find('input').val('') } } else { alert('请输入内容') } }) $("#addBooksInfo").click(); $("#btn_add").click(function(){ console.log('add'); $("#addBook").modal() }); $('#btn_edit').click(function () { console.log('edit'); if (table.rows('.selected').data().length) { $("#editBookInfo").modal() var rowData = table.rows('.selected').data()[0]; var inputs = $("#editBookModal").find('input') for (var i = 0; i < inputs.length; i++) { $(inputs[i]).val(rowData[i + 1]) } } else { alert('请选择项目'); } }); $("#saveEdit").click(function() { var editBookName = $("#editBookName").val() var editBookAuthor = $("#editBookAuthor").val() var editBookPrice = $("#editBookPrice").val() var editBookPublish = $("#editBookPublish").val() var editBookISBN = $("#editBookISBN").val() var newRowData = [].concat(editBookName, editBookAuthor, editBookPrice, editBookPublish, editBookISBN); var tds = Array.prototype.slice.call($('.selected td')) for (var i = 0; i < newRowData.length; i++) { if (newRowData[i] !== '') { tds[i + 1].innerHTML = newRowData[i]; } else { alert(titles[i] + '内容不能为空') } } }) $("#cancelEdit").click(function() { console.log('cancelAdd'); $("#editBookModal").find('input').val('') }) $('#btn_delete').click(function () { if (table.rows('.selected').data().length) { $("#deleteBook").modal() } else { alert('请选择项目'); } }); $('#delete').click(function () { table.row('.selected').remove().draw(false); }); }) </script> </html> ``麻烦各位大佬帮下忙
Jquery Mobile Ajax ASP.NET控件 无刷新页面查询,添加,修改,删除
Jquery Mobile Ajax 技术用ASP.NET控件怎么实现无刷新页面查询,添加,修改,删除功能? 现在刷新一次才能执行JavaScript代码,否则没反应,有时候样式也没了。 我写的代码如下: ``` <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="css/jquery.mobile-1.4.5.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" /> <script src="js/jquery.js"></script> <script src="js/jquery.mobile-1.4.5.min.js"></script> </head> <body> <form id="form1" runat="server"> <div data-role="page" data-quicklinks="true"> <div data-role="header"><h1>标题</h1></div> <div role="main"> <ul data-role="listview"> <li><a href="TestSql.aspx?key=1">AAA</a></li> <li><a href="TestSql.aspx?key=2">BBB</a></li> </ul> </div> <div data-role="footer" data-position="fixed"><h4>©2013-2015</h4></div> </div> </form> </body> </html> ``` ``` <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestSql.aspx.cs" Inherits="TestSql" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="css/jquery.mobile-1.4.5.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" /> <script src="js/jquery.js"></script> <script src="js/jquery.mobile-1.4.5.min.js"></script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div data-role="page"> <div data-role="header"><h1>标题</h1><a href="Default.aspx" data-icon="arrow-r"><% =GetCityName() %></a></div> <div id="tabs" data-role="tabs"> <div data-role="navbar"> <ul> <li><a href="#one" data-ajax="false">第一</a></li> <li><a href="#two" data-ajax="false">第二</a></li> </ul> </div> <div class="ui-body-d ui-content" id="one"> <asp:DropDownList data-native-menu="false" ID="ddlSort" runat="server" OnSelectedIndexChanged="ddlSort_SelectedIndexChanged"></asp:DropDownList> <asp:DropDownList data-native-menu="false" ID="ddlCity" runat="server"></asp:DropDownList> <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="ui-btn-active" /> </div> <div id="two"> <ul data-role="listview" data-inset="true"> <li><a href="#">A</a></li> <li><a href="#">B</a></li> <li><a href="#">C</a></li> <li><a href="#">D</a></li> <li><a href="#">E</a></li> </ul> </div> </div> <div data-role="footer" data-position="fixed"><h4>©2013-2015</h4></div> </div> </ContentTemplate> </asp:UpdatePanel> </form> </body> </html> ``` ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class TestSql : System.Web.UI.Page { SqlEditForOleDb ed = new SqlEditForOleDb(); string CityNumber = string.Empty; int StationSortIndex = 0; string StationSortName = string.Empty; int StationIndex = 0; string StationName = string.Empty; protected void Page_Load(object sender, EventArgs e) { try { CityNumber = Request.QueryString["key"].ToString(); Session["CityID"] = CityNumber; if (CityNumber == string.Empty) { Response.Redirect("Default.aspx"); } } catch { Response.Redirect("Default.aspx"); } ddlSort.AutoPostBack = true; ddlCity.AutoPostBack = true; if (!IsPostBack) { ddlSort.Items.Add("A"); ddlSort.Items.Add("B"); ddlSort.Items.Add("C"); ddlSort.Items.Add("D"); ddlSort.Items.Add("E"); ddlCity.Enabled = false; } else if (ddlSort.SelectedIndex == 0) { ddlCity.Enabled = false; } StationSortName = ddlSort.Text; StationSortIndex = ddlSort.SelectedIndex; StationName = ddlCity.Text; StationIndex = ddlCity.SelectedIndex; } public string GetCityName() { string str = string.Empty; try { str = ed.Search("SELECT 名称 FROM 城市 WHERE ID = " + CityNumber).Rows[0][0].ToString(); } catch { } return str; } public string GetCityID() { string str = string.Empty; try { str = Session["CityID"].ToString(); } catch { } return str; } protected void ddlSort_SelectedIndexChanged(object sender, EventArgs e) { ddlCity.Items.Clear(); if (ddlSort.SelectedIndex == 0) { ddlCity.Enabled = false; } else { ddlCity.Enabled = true; DataTable dtStation = new DataTable(); dtStation = ed.Search("SELECT DISTINCT 城市.名称 FROM 城市 WHERE 城市.名称 like '" + StationSortName + "%'"); for (int i = 0; i < dtStation.Rows.Count; i++) { ddlCity.Items.Add(dtStation.Rows[i][0].ToString()); } } } } ```
Metronic UI框架表格管理问题
想问下这个Metronic managed -table使用的时候 ``` var User = function () { var inittable = function(){ var oTable = $('#usertable').dataTable( { "bServerSide": true, "sAjaxSource": "listuser", "bProcessing": false, //simple_numbers full_numbers //"sPaginationType": "two_button", "bFilter": true,//过滤功能 "bSort": false,//排序功能 "oLanguage": { "sUrl": "js/datatable-cn.txt", "sSearch":"登陆名:" }, "aoColumnDefs": [{ 'bSortable': false, 'aTargets': [0] }], "aoColumns": [ { "mDataProp": function(lineData){ var id = lineData.id; return '<input type="checkbox" name="ck_user" class="checkboxes" value="'+id+'"/>'; }}, { "mDataProp": "id" }, { "mDataProp": "firstName" }, { "mDataProp": "lastName" }, { "mDataProp": "email" }, { "mDataProp": function(lineData){ var id = lineData.id; var del = '<button id="sample_editable_1_new" class="btn red" onclick="del(\''+id+'\')">删除<i class="icon-minus"></i></button>'; var edit = '<button id="sample_editable_1_new" class="btn green" onclick="edit(\''+id+'\')">编辑<i class="icon-minus"></i></button>'; var initGroup = '<button id="sample_editable_1_new" class="btn green" onclick="initGroup(\''+id+'\')">角色分配<i class="icon-minus"></i></button>'; return del +" " +initGroup +" " +edit; } } ] } ); $('#ckcolum input[type="checkbox"]').change(function(){ var iCol = parseInt($(this).attr("data-column")); var bVis = oTable.fnSettings().aoColumns[iCol].bVisible; oTable.fnSetColumnVis(iCol, (bVis ? false : true)); }); //添加全选和反选功能 jQuery('#usertable .group-checkable').change(function () { var set = jQuery(this).attr("data-set"); var checked = jQuery(this).is(":checked"); jQuery(set).each(function () { if (checked) { $(this).attr("checked", true); } else { $(this).attr("checked", false); } }); jQuery.uniform.update(set); }); jQuery('#usertable_wrapper .dataTables_filter input').addClass("m-wrap small"); // modify table search input jQuery('#usertable_wrapper .dataTables_length select').addClass("m-wrap small"); // modify table per page dropdown jQuery('#usertable_wrapper .dataTables_length select').select2(); // initialzie select2 dropdown }; return { init: function () { inittable(); } }; }(); ``` 创建实例如上代码,效果图如下:![图片说明](https://img-ask.csdn.net/upload/201412/29/1419835405_993468.jpg) 1、查询怎么样才能起作用? 2、前面的checkbox我是动态创建的,之前按照框架源码加上了相应的样式,但是前面的点击事件不可用了,不知道是什么原因? 3、这个表格如果数据做了修改,怎么让他动态刷新?
laravel 5.8 blade模板里的 @extends 和@push 标签,编辑页面没有解析成功,但是列表页却能够正常解析,新手求大佬解答
create 页面 ``` @extends('back.app') @push('X-CSRF-TOKEN') <meta name="csrf-token" content="{{ csrf_token() }}"> @endpush @push('remodal_css') <!-- remodal--> <link rel="stylesheet" href="{{asset('/remodal/remodal-default-theme.css')}}"> <link rel="stylesheet" href="{{asset('/remodal/remodal.css')}}"> @endpush @section('content') <style> .skin-blue .sidebar-form input[type="text"], .skin-blue .sidebar-form .btn{ background-color: #fff; } </style> <div class="row"> <form action="{{route('menu.store')}}" method="post" class="form_single"> @csrf <div class="box"> <div class="box-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.list_name')}}</label> <input class="form-control" name="name" placeholder="{{trans('common.menu_name')}}" value="{{get_fit_val($data,'name')}}" type="text"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.sort')}}</label> <input class="form-control" name="sort" placeholder="{{trans('common.sort')}}" value="{{get_fit_val($data,'sort')}}" type="text"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.route')}}</label> <input class="form-control" name="route" placeholder="{{trans('common.menu_route')}}" value="{{get_fit_val($data,'route')}}" type="text"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.up_menu')}}</label> <select name="pid" class="form-control"> <option value="0">{{trans('common.top_menu')}}</option> @foreach ($data['sel_menu'] as $v) <option value="{{$v['id']}}" @if (get_fit_val($data,'pid') == $v['id']) selected @endif>{!!$v['name']!!}</option> @endforeach </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.icon')}}</label> @include('back.layouts.icon') </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.is_show')}}</label> <div style="height:34px;line-height: 34px;"> <label class="margin-r-5"><input type="radio" name="is_show" value="1" @if(get_fit_val($data,'is_show')==1 or get_fit_val($data,'status')=='') checked @endif> {{trans('common.yes')}}</label> <label><input type="radio" name="is_show" value="2" @if(get_fit_val($data,'is_show')==2) checked @endif> {{trans('common.no')}}</label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>{{trans('common.status')}}</label> <div> <label class="margin-r-5"><input type="radio" name="status" value="1" @if(get_fit_val($data,'status')==1 or get_fit_val($data,'status')=='') checked @endif> {{trans('common.enable')}}</label> <label><input type="radio" name="status" value="2" @if(get_fit_val($data,'status')==2) checked @endif> {{trans('common.forbidden')}}</label> </div> </div> </div> </div> </div> <div class="box-footer"> <input type="hidden" name="id" value="{{get_fit_val($data,'id')}}"/> <button type="submit" class="btn btn-primary margin" data-style="slide-up" target-form="form_single"> <span class="ladda-label"><i class="fa fa-send"></i> {{trans('common.comfirm_space')}}</span> </button> <a class="btn btn-primary margin" href="{{go_back()}}"><i class="fa fa-history"></i> {{trans('common.back_space')}}</a> </div> </div> </form> </div> @endsection @push('remodal_scripts') <script src="{{asset('/remodal/remodal.min.js')}}"></script> @endpush ``` 继承的模板 ``` <!DOCTYPE html> <!-- This is a starter template page. Use this page to start your new project from scratch. This page gets rid of all links and provides the needed markup only. --> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AdminLTE 2 | Starter</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> @stack('X-CSRF-TOKEN') <link rel="stylesheet" href="{{asset('/adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css')}}"> <!-- Font Awesome --> <link rel="stylesheet" href="{{asset('/adminlte/bower_components/font-awesome/css/font-awesome.min.css')}}"> @stack('datepicker_css') @stack('datatable_css') @stack('remodal_css') <!-- Ionicons --> <link rel="stylesheet" href="{{asset('/adminlte/bower_components/Ionicons/css/ionicons.min.css')}}"> <!-- Theme style --> <link rel="stylesheet" href="{{asset('/adminlte/dist/css/AdminLTE.min.css')}}"> <!-- AdminLTE Skins. We have chosen the skin-blue for this starter page. However, you can choose any other skin. Make sure you apply the skin class to the body tag so the changes take effect. --> <link rel="stylesheet" href="{{asset('/adminlte/dist/css/skins/skin-blue.min.css')}}"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <!-- Google Font --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic"> <!-- jQuery 3 --> <script src="{{asset('/adminlte/bower_components/jquery/dist/jquery.min.js')}}"></script> <!-- Bootstrap 3.3.7 --> <script src="{{asset('/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js')}}"></script> <!-- AdminLTE App --> <script src="{{asset('/adminlte/dist/js/adminlte.min.js')}}"></script> </head> <!-- BODY TAG OPTIONS: ================= Apply one or more of the following classes to get the desired effect |---------------------------------------------------------| | SKINS | skin-blue | | | skin-black | | | skin-purple | | | skin-yellow | | | skin-red | | | skin-green | |---------------------------------------------------------| |LAYOUT OPTIONS | fixed | | | layout-boxed | | | layout-top-nav | | | sidebar-collapse | | | sidebar-mini | |---------------------------------------------------------| --> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> @include('back.layouts.header') @include('back.layouts.sidebar') <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> @include('back.layouts.tip') <h1> Page Header <small>Optional description</small> </h1> <!-- <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li> <li class="active">Here</li> </ol>--> </section> <!-- Main content --> <section class="content container-fluid"> @yield('content') </section> <!-- /.content --> </div> <!-- /.content-wrapper --> @include('back.layouts.footer') <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Create the tabs --> <ul class="nav nav-tabs nav-justified control-sidebar-tabs"> <li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li> <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <!-- Home tab content --> <div class="tab-pane active" id="control-sidebar-home-tab"> <h3 class="control-sidebar-heading">Recent Activity</h3> <ul class="control-sidebar-menu"> <li> <a href="javascript:;"> <i class="menu-icon fa fa-birthday-cake bg-red"></i> <div class="menu-info"> <h4 class="control-sidebar-subheading">Langdon's Birthday</h4> <p>Will be 23 on April 24th</p> </div> </a> </li> </ul> <!-- /.control-sidebar-menu --> <h3 class="control-sidebar-heading">Tasks Progress</h3> <ul class="control-sidebar-menu"> <li> <a href="javascript:;"> <h4 class="control-sidebar-subheading"> Custom Template Design <span class="pull-right-container"> <span class="label label-danger pull-right">70%</span> </span> </h4> <div class="progress progress-xxs"> <div class="progress-bar progress-bar-danger" style="width: 70%"></div> </div> </a> </li> </ul> <!-- /.control-sidebar-menu --> </div> <!-- /.tab-pane --> <!-- Stats tab content --> <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div> <!-- /.tab-pane --> <!-- Settings tab content --> <div class="tab-pane" id="control-sidebar-settings-tab"> <form method="post"> <h3 class="control-sidebar-heading">General Settings</h3> <div class="form-group"> <label class="control-sidebar-subheading"> Report panel usage <input type="checkbox" class="pull-right" checked> </label> <p> Some information about this general settings option </p> </div> <!-- /.form-group --> </form> </div> <!-- /.tab-pane --> </div> </aside> <!-- /.control-sidebar --> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div> <!-- ./wrapper --> <!-- REQUIRED JS SCRIPTS --> @stack('datepicker_scripts') @stack('datatable_scripts') @stack('remodal_scripts') <script src="{{asset('/admin/js/common.js')}}"></script> <!-- Optionally, you can add Slimscroll and FastClick plugins. Both of these plugins are recommended to enhance the user experience. --> </body> </html> ``` create 页面效果 ![](https://img-ask.csdn.net/upload/201910/22/1571713579_947602.png) list 页面效果 ![图片说明](https://img-ask.csdn.net/upload/201910/22/1571713627_46284.png)
初接触dataTables。想将表格导出为csv文件,希望大神们帮帮忙!!
下面是我初始化dataTable的代码 $('#sample-table-2') .dataTable( { bAutoWidth: false, "aoColumns": [ { "bSortable": false }, null, null,null, null, null,null, { "bSortable": false } ], "aaSorting": [], // "searching":false, // "bFilter":null, // "sSearch":true, "oLanguage": {"sSearch": '搜索:'}, "sDom": "<'row'<'col-xs-6'l><'toolbar'f>r>"+ "t"+ "<'row'<'col-xs-6'i><'col-xs-6'p><'bottom'>>", "oTableTools": { "aButtons": [ { "sExtends": "csv", "sButtonText": "导出Excel", "sCharSet": "utf8" } ] } } ); $("div.bottom").html('<button style="color:#f78234" onclick="">导出csv文件</button');
分页后GrideView新增一行空白行
项目中有个需求,需要对已经绑定数据并分页的GrideView进行新增一行空白行。用户在点击“新增行”后,在界GrideView界面的最下面增加一行空白行。 要求:1、用户在第几页点击新增行就在当前页面显示新增行; 2、新增行按钮在GrideView外面; 具体代码如下: ``` 前台页面代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YPCGJCB.aspx.cs" Inherits="CenterBase.供应链管理.YPCGJCB" %> <%@ Register Assembly="UserControls" Namespace="UserControls" TagPrefix="cc2" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>药品折扣基础表</title> <link rel="stylesheet" href="../js/Grid/css/demo_page.css" /> <link rel="stylesheet" href="../js/DatePicker/base/jquery-ui.css" /> <script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="../js/JScript.js" type="text/javascript"></script> <script src="../js/DatePicker/jquery.ui.core.js" type="text/javascript"></script> <script src="../js/DatePicker/jquery.ui.datepicker.js" type="text/javascript"></script> <script src="../js/Ajax.js"></script> <script src="../js/jquery-1.4.1.js"></script> <style type="text/css"> .auto-style2 { height: 25px; } .auto-style3 { width: 156px; height: 25px; } .auto-style4 { margin-top: 5px; } .auto-style5 { text-align: right; } </style> <script language="javascript" type="text/javascript"> var dgPersonsID = "<%= YPZKXX.ClientID %>"; $(document).ready(function () { $("#dgPersons tr").eq(1).hide(); }); function AddNewRow() { var tr = $("#dgPersons tr").eq(1).clone(); tr.show(); tr.appendTo("#dgPersons"); refreshNo(); return false; } function refreshNo() { var dgg = document.getElementById(dgPersonsID); var index = 1; for (var i = 2; i < dgg.rows.length; ++i) { var cells = dgg.rows[i].cells; var row = dgg.rows[i]; if (row.style.display != "none") { cells[0].firstChild.nodeValue = index++; } } return false; } </script> </head> <body id="dt_example" class="ex_highlight_row"> <form id="form1" runat="server"> <div id="container"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image: url(../images/Pop_page_back.gif)" align="center"> <tr> <td valign="center" style="height: 27px">&nbsp;<strong>药品折扣基础表</strong></td> </tr> </table> <div id="search"> <table class="t2" style="width:100%"> <tr> <td class="auto-style2">医院名称:</td> <td class="auto-style3"> <input type="text" id="txtyymc" runat="server" class="inputbox" readonly="true"/> </td> <td class="auto-style2">开始时间:</td> <td class="auto-style2"> <input type="text" id="txtkssj" runat="server" class="inputbox" readonly="true" /> </td> <td class="auto-style2">结束时间:</td> <td class="auto-style2"> <input type="text" id="txtjssj" runat="server" class="inputbox" readonly="true"/> </td> <td class="auto-style2">供应商名称:</td> <td class="auto-style2"> <input type="text" id="txtgys" runat="server" class="inputbox" readonly="true"/> </td> </tr> </table> </div> <div id="menu" class="auto-style5"> &nbsp;<asp:Button ID="Btn_Download" runat="server" Text="查 询" CssClass="buttoncss" OnClick="Btn_Download_Click"/> &nbsp; &nbsp;<asp:Button ID="btn_AddLine" runat="server" Text="新增行" CssClass="buttoncss" OnClientClick="return AddNewRow();return false;" /> &nbsp; &nbsp;<asp:Button ID="btn_xz" runat="server" Text="下 载" CssClass="buttoncss"/> &nbsp; &nbsp<asp:Button ID="btn_dr" runat="server" Text="导 入" CssClass="buttoncss" OnClick="btn_dr_Click" /> &nbsp; &nbsp;<asp:CheckBox runat="server" Text="显示历史数据" ID="cbo_xs" Checked="false" /> </div> <div> <asp:GridView ID="YPZKXX" runat="server" AutoGenerateColumns="False" Width="100%" HorizontalAlign="Center" style="text-align: center" NoNewline="word-break: keep-all;" CssClass="auto-style4" OnRowCancelingEdit="YPCGJCXX_RowCancelingEdit" OnRowEditing="YPCGJCXX_RowEditing" OnRowUpdating="YPCGJCXX_RowUpdating"> <EmptyDataTemplate> 没有数据 </EmptyDataTemplate> <FooterStyle ForeColor="White" BackColor="#3B6BD1" Font-Bold="True"></FooterStyle> <SelectedRowStyle Font-Bold="True" ForeColor="Navy" BackColor="#FFCC66" BorderColor="CornflowerBlue" /> <RowStyle ForeColor="#333333" BackColor="#FFFBD6" BorderColor="CornflowerBlue" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Bottom" Wrap="False" /> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#3B6BD1" Wrap="False"></HeaderStyle> <Columns> <asp:TemplateField HeaderText="编号" Visible="false"> <ItemTemplate> <asp:Label ID="lbl_ID" runat="server" Text='<%# Bind("ID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="医院名称"> <ItemTemplate> <asp:Label ID="lbl_yymc" runat="server" Text='<%# Bind("yymc") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="供货商编码"> <ItemTemplate> <asp:Label ID="lbl_ghsbm" runat="server" Text='<%# Bind("ghsbm") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="中心编码"> <ItemTemplate> <asp:Label ID="txt_zxbm" runat="server" Text='<%# Bind("zxbm") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="药品编码"> <ItemTemplate> <asp:Label ID="lbl_ypbm" runat="server" Text='<%# Bind("ypbm") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="药品名称"> <ItemTemplate> <asp:Label ID="lbl_ypmc" runat="server" Text='<%# Bind("ypmc") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="药品规格"> <ItemTemplate> <asp:Label ID="lbl_ypgg" runat="server" Text='<%# Bind("ypgg") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="药品单位"> <ItemTemplate> <asp:Label ID="lbl_ypdw" runat="server" Text='<%# Bind("ykdw") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="返利形式"> <ItemTemplate> <asp:Label ID="txt_flxs" runat="server" Text='<%# Bind("flxs") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="厂家名称"> <ItemTemplate> <asp:Label ID="lbl_sccj" runat="server" Text='<%# Bind("cjmc") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="供货单位"> <ItemTemplate> <asp:Label ID="lbl_ghdw" runat="server" Text='<%# Bind("ghdw") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="底 价"> <ItemTemplate> <asp:Label ID="txt_dj" runat="server" Text='<%# Bind("dj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="折扣率"> <ItemTemplate> <asp:Label ID="txt_zkl" runat="server" Text='<%# Bind("zkl") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="开票价"> <ItemTemplate> <asp:Label ID="txt_kpj" runat="server" Text='<%# Bind("kpj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="零售价"> <ItemTemplate> <asp:Label ID="lbl_lsj" runat="server" Text='<%# Bind("lsj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="最新零售价"> <ItemTemplate> <asp:Label ID="lbl_zxlsj" runat="server" Text='<%# Bind("zxlsj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="售价差价"> <ItemTemplate> <asp:Label ID="txt_sjcj" runat="server" Text='<%# Bind("lscj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="成本价"> <ItemTemplate> <asp:Label ID="txt_cbj" runat="server" Text='<%# Bind("cbj") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="折 扣"> <ItemTemplate> <asp:Label ID="txt_zk" runat="server" Text='<%# Bind("zk") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="净利润"> <ItemTemplate> <asp:Label ID="txt_jlr" runat="server" Text='<%# Bind("jlr") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="业务费"> <ItemTemplate> <asp:Label ID="txt_ywf" runat="server" Text='<%# Bind("xywf") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="毛利率"> <ItemTemplate> <asp:Label ID="txt_mll" runat="server" Text='<%# Bind("mll") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="年"> <ItemTemplate> <asp:Label ID="lbl_nf" runat="server" Text='<%# Bind("nian") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="月"> <ItemTemplate> <asp:Label ID="lbl_yf" runat="server" Text='<%# Bind("yue") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="管理" ShowHeader="False"> <EditItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="更新"></asp:LinkButton> &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消"></asp:LinkButton> </EditItemTemplate> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="编辑"></asp:LinkButton> &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Update" Text="修改"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> <cc2:PageTool ID="PageTool1" runat="server" Number="1" PageRows="10" PageCount="100"> </cc2:PageTool> </div> </form> </body> </html> ``` ``` 后台代码: using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace CenterBase.供应链管理 { public partial class YPCGJCB : System.Web.UI.Page { CenterBaseBLL.YPCGMC cbby = new CenterBaseBLL.YPCGMC(); private static int pCount = 0;//总页数 private static int rCount = 0;//总数据数 private static int pageIndex = 1;//当前页 private static int pageSize = 20;//页面大小 private static string tableName = "View_YPJCB";//表名 private static string fields = "ID,yymc, ghsbm, zxbm, ypbm, ypmc, ypgg, ykdw, flxs,cjmc,ghdw,dj,zkl,kpj,lsj,zxlsj,lscj,cbj,zk,jlr,xywf,mll,nian,yue";//查询的字段 private static string order = "ID desc";//排序 private static string primaryKey = "ID";//关键字 private static string where = " "; protected void Page_Load(object sender, EventArgs e) { //UnobtrusiveValidationMode = UnobtrusiveValidationMode.None; //Response.AddHeader("P3P", "CP=CAO PSA OUR"); ////检测用户是否登录 //if (!CheckUserLogin()) //{ // Response.Redirect("../LoginMain.aspx"); //} ////检测用户是否具有权限 //if (!CheckUserAuthority()) //{ // Response.Redirect("../LoginMain.aspx"); //} if (!Page.IsPostBack) { //分页初始化 if (Request.QueryString["page"] == null) { pageIndex = 1; } else { pageIndex = CenterBaseTools.ConvertData.ConvertDataFromStringToInt(Request.QueryString["page"].ToString()); } ////绑定数据 //if (cbo_xs.Checked == true) //{ //} DataBinds(); //Sum(); } } protected void Btn_Download_Click(object sender, EventArgs e) { where = ""; if (sqlwhere() != "") { where = where + sqlwhere(); } DataBinds(); } public void DataBinds() { DataTable dt = new DataTable(); dt = CenterBaseBLL.PageView.GetAll(out pCount, out rCount, pageIndex, pageSize, tableName, fields, order, primaryKey, 2, 0, where); YPZKXX.DataSource = dt; YPZKXX.DataBind(); this.PageTool1.PageRows = pageSize; this.PageTool1.PageCount = rCount; } public string sqlwhere() { string yymc = txtyymc.Value.ToString(); string kssk = txtkssj.Value.ToString(); string jssj = txtjssj.Value.ToString(); string ghs = txtgys.Value.ToString(); int res = kssk.CompareTo(jssj); string sql = ""; if (yymc != "") { sql = sql + " where CYYMC = '" + yymc + "'"; } if (yymc != "" && kssk != "" && jssj != "" && res < 0) { sql = sql + " where CYYMC='" + yymc + "' and DRKRQ between '" + kssk + "' and '" + jssj + "'"; } if (yymc != "" && kssk != "" && jssj != "" && res < 0 && ghs != "") { sql = sql + " where CYYMC='" + yymc + "' and DRKRQ between '" + kssk + "' and '" + jssj + "' and CGHDW = '" + ghs + "'"; } return sql; } protected void YPCGJCXX_RowEditing(object sender, GridViewEditEventArgs e) { YPZKXX.EditIndex = e.NewEditIndex; DataBinds(); } protected void YPCGJCXX_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { YPZKXX.EditIndex = -1; DataBinds(); } protected void YPCGJCXX_RowUpdating(object sender, GridViewUpdateEventArgs e) { int id = Convert.ToInt32((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ID") as Label).Text); string yymc = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_yymc") as Label).Text); string ghsbm = (YPZKXX.Rows[e.RowIndex].FindControl("txt_ghsbm") as TextBox).Text.ToString(); string zxbm = (YPZKXX.Rows[e.RowIndex].FindControl("txt_zxbm") as TextBox).Text.ToString(); string ypbm = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ypbm") as Label).Text); string ypmc = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ypmc") as Label).Text); string ypgg = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ypgg") as Label).Text); string ypdw = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ypdw") as Label).Text); string flxs = (YPZKXX.Rows[e.RowIndex].FindControl("txt_flxs") as TextBox).Text.ToString(); string cjmc = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_sccj") as Label).Text); string ghdw = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_ghdw") as Label).Text); string dj = (YPZKXX.Rows[e.RowIndex].FindControl("txt_dj") as TextBox).Text.ToString(); string zkl = (YPZKXX.Rows[e.RowIndex].FindControl("txt_zkl") as TextBox).Text.ToString(); string kpj = (YPZKXX.Rows[e.RowIndex].FindControl("txt_kpj") as TextBox).Text.ToString(); string lsj = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_lsj") as Label).Text); string dykpj = (YPZKXX.Rows[e.RowIndex].FindControl("txt_dykpj") as TextBox).Text.ToString(); string zxlsj = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_zxlsj") as Label).Text); string sjcj = (YPZKXX.Rows[e.RowIndex].FindControl("txt_sjcj") as TextBox).Text.ToString(); string cbj = (YPZKXX.Rows[e.RowIndex].FindControl("txt_cbj") as TextBox).Text.ToString(); string zk = (YPZKXX.Rows[e.RowIndex].FindControl("txt_zk") as TextBox).Text.ToString(); string jlr = (YPZKXX.Rows[e.RowIndex].FindControl("txt_jlr") as TextBox).Text.ToString(); string ywf = (YPZKXX.Rows[e.RowIndex].FindControl("txt_ywf") as TextBox).Text.ToString(); string mll = (YPZKXX.Rows[e.RowIndex].FindControl("txt_mll") as TextBox).Text.ToString(); string nf = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_nf") as Label).Text); string yf = Convert.ToString((YPZKXX.Rows[e.RowIndex].FindControl("lbl_yf") as Label).Text); DateTime time = System.DateTime.Now; string sql = "insert into YPFXJCXX(yymc,ghsbm,zxbm,ypbm,ypmc,ypgg,ykdw,flxs,cjmc,ghdw,dj,zkl,kpj,lsj,dykpj,zxlsj,lscj,cbj,zk,jlr,xywf,mll,nian,yue,ITime)" + "values(" + "'" + yymc + "'," + "'" + ghsbm + "'," + "'" + zxbm + "'," + "'" + ypbm + "'," + "'" + ypmc + "'," + "'" + ypgg + "'," + "'" + ypdw + "'," + "'" + flxs + "'," + "'" + cjmc + "'," + "'" + ghdw + "'," + "'" + dj + "'," + "'" + zkl + "'," + "'" + kpj + "'," + "'" + lsj + "'," + "'" + dykpj + "'," + "'" + zxlsj + "'," + "'" + sjcj + "'," + "'" + cbj + "'," + "'" + zk + "'," + "'" + jlr + "'," + "'" + ywf + "'," + "'" + mll + "'," + "'" + nf + "'," + "'" + yf + "'," + "'" + time + "'" + ")"; CenterBaseDAL.ExecuteSql exec = new CenterBaseDAL.ExecuteSql(); int falg = exec.run(sql); if (falg == 1) { Response.Write("<script>alert('更新成功')</script>"); Response.Write("<script>window.location.href='YPCGJCB.aspx'</script>"); Response.End(); } else { Response.Write("<script>alert('更新失败')</script>"); } } protected void btn_dr_Click(object sender, EventArgs e) { Response.Write("<script>window.open('药品销售明细查询/Improt.aspx','_blank')</script>"); } } } ``` 我用自己方法添加了一列行号,求大神指点!!
style未定义!!!!!!!!!!!
<%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <c:set var="ctx" value="${pageContext.request.contextPath}"/> <!DOCTYPE HTML> <html> <head> <jsp:include page="/WEB-INF/jsp/web/common.jsp"/> <title>用户管理</title> </head> <body> <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" id="refresh"><i class="Hui-iconfont">&#xe68f;</i></a> </nav> <div class="page-container"> <div class="text-c"> <button onclick="removeIframe()" class="btn btn-primary radius">关闭选项卡</button> <span class="select-box inline"> <select class="select" id="sel_Sub" name="uuid" onchange=""> <c:forEach items="${cList}" var="item"> <option value="${item.id}">${item.user_name}</option> </c:forEach> </select> </span> <input type="text" name="" id="search-name" placeholder="用户名称、id" style="width:250px" class="input-text"> <button name="" id="search" class="btn btn-success" onclick="search();"><i class="Hui-iconfont">&#xe665;</i> 搜索 </button> </div> <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a href="javascript:" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" onclick="system_user_add('添加用户','${ctx}/system/system-user-add')" href="javascript:"><i class="Hui-iconfont">&#xe600;</i> 添加用户</a> </span> <!--<span class="r">共有数据:<strong>54</strong> 条</span>--> </div> <div class="mt-20"> <table class="table table-border table-bordered table-hover table-bg table-sort"> <thead> <tr class="text-c"> <th width="25"><input type="checkbox" name="" value=""></th> <th width="20">用户名称</th> <th width="80">手机号</th> <th width="80">邮箱</th> <th width="20">操作</th> </tr> </thead> <tbody></tbody> </table> </div> </div> <jsp:include page="/WEB-INF/jsp/web/footer.jsp"/> <script type="text/javascript" src="${ctx}/lib/My97DatePicker/4.8/WdatePicker.js"></script> <script type="text/javascript" src="${ctx}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> <script type="text/javascript" src="${ctx}/lib/laypage/1.2/laypage.js"></script> <script type="text/javascript"> var dataTable = $('.table-sort').dataTable({ "aaSorting": [[1, "desc"]],//默认第几个排序 "bStateSave": true,//状态保存 "searching": false, //开启搜索标志 "bProcessing": true, "aoColumnDefs": [ //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示 {"orderable": false, "aTargets": [0, 1, 3, 4, 5]}// 制定列不参与排序 ], "serverSide": true,//服务器分页标志 //ajax地址 "sAjaxSource": "${ctx}/system/system-user-list/json.dt",// action地址 "fnServerData": retrieveData,//执行方法 "fnRowCallback": retrieveColumnData,//返回数据重构 "fnServerParams": function (aoData) { aoData.push( {"name": "search", "value": $('#search-name').val()}, {"name": "uuid", "value": $('#sel_Sub').val()} ) }, //配置列要显示的数据 "columns": [ {"data": null}, {"data": "USER_NAME"}, {"data": "MOBILE"}, {"data": "EMAIL"}, {"data": null} ] }); function retrieveColumnData(nRow, aData, iDisplayIndex) { $('td:eq(0)', nRow).html('&nbsp;<input type="checkbox" value="" name="">'); var last = "<a title=\"编辑\" href=\"javascript:\"\n" + " onclick=\"system_user_edit('用户编辑','${ctx}/system/system-user-add','" + aData.UUID + "')\"\n" + " style=\"text-decoration:none\"><i class=\"Hui-iconfont\">&#xe6df;</i></a>\n" + " <a title=\"删除\" href=\"javascript:\" onclick=\"system_user_del(this,'" + aData.UUID + "')\" class=\"ml-5\"\n" + " style=\"text-decoration:none\"><i class=\"Hui-iconfont\">&#xe6e2;</i></a>"; $('td:last', nRow).html(last); $('td:last', nRow).addClass('f-14'); $(nRow).addClass('text-c'); return nRow; } function retrieveData(sSource, aoData, fnCallback) { /* post 方法调用*/ $.ajax({ "type": "post", "contentType": "application/json", "cache": false, //禁用缓存 "url": sSource, "dataType": "json", "data": JSON.stringify(aoData), "success": function (resp) { fnCallback(resp); //服务器端返回的对象的returnObject部分是要求的格式 } }); } /*系统-用户-添加*/ function system_user_add(title, url, w, h) { layer_show(title, url, w, h); } /*系统-用户-编辑*/ function system_user_edit(title, url, id, w, h) { layer_show(title, url + '?id=' + id, w, h); } /*系统-用户-删除*/ function system_user_del(obj, id) { layer.confirm('确认要删除吗?', function (index) { $.ajax({ type: 'POST', url: '', dataType: 'json', success: function (data) { $(obj).parents("tr").remove(); layer.msg('已删除!', {icon: 1, time: 1000}); }, error: function (data) { console.log(data.msg); }, }); }); } function search() { dataTable.fnDraw(); } </script> </body> </html>
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
世界上有哪些代码量很少,但很牛逼很经典的算法或项目案例?
点击上方蓝字设为星标下面开始今天的学习~今天分享四个代码量很少,但很牛逼很经典的算法或项目案例。1、no code 项目地址:https://github.com/kelseyhight...
​两年前不知如何编写代码的我,现在是一名人工智能工程师
全文共3526字,预计学习时长11分钟 图源:Unsplash 经常有小伙伴私信给小芯,我没有编程基础,不会写代码,如何进入AI行业呢?还能赶上AI浪潮吗? 任何时候努力都不算晚。 下面,小芯就给大家讲一个朋友的真实故事,希望能给那些处于迷茫与徘徊中的小伙伴们一丝启发。(下文以第一人称叙述) 图源:Unsplash 正如Elsa所说,职业转换是...
立即提问