bootstrapTable 修改栏位值
来源:互联网 发布:手机淘宝怎么投诉商家 编辑:程序博客网 时间:2024/05/17 18:13
function initEnvironmentSensorTable() { //初始化EnvironmentSensor的bootstrap-table的表格
tableEnvironmentSensor = $('#environmentSensor_table').bootstrapTable({
method: 'get', //请求方式(*)
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: true, //是否显示分页(*)
sortable: false, //是否启用排序
sortOrder: "asc", //排序方式
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 6, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
clickToSelect: true,
showExport: true, //是否显示导出
singleSelect:true,
exportDataType: "basic", //basic', 'all', 'selected'.
columns: [
{
field : '',
title : '編號',
align:'center',
valign:'middle',
formatter : function(value, row, index) {
return index + 1;
}
},
{
checkbox: true
}, {
field: 'sensor_kind',
title: '傳感器種類',
align:'center',
valign:'middle',
}, {
field: 'sensor_Interface',
title: '接口類型',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'select',
title:'接口類型',
source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": v,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
}, {
field: 'sensor_brand',
title: '品牌型號',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'品牌型號',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": objjson.sensor_Interface,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":v,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
} ,
{
field: 'sensor_Supplier',
title: '供應商',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'供應商',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface":objjson.sensor_Interface,
"Sensor_Supplier":v,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
} ,
{
field: 'sensor_tel',
title: '供應商電話',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'供應商電話',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": objjson.sensor_Interface,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":v
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
}
],
formatLoadingMessage: function(){
return "";
},
onCheck:function(row){//选择table某一行
var selectContent = tableEnvironmentSensor.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
//alert(objjson.sensor_KEY+" "+objjson.sensor_Interface+" "+objjson.sensor_Supplier+" "+objjson.sensor_brand+" "+objjson.sensor_kind+" "+objjson.sensor_tel);
$("#EnvironmentSensorClear").attr("disabled","disabled");//清除无效
$("#EnvironmentSensorAdd").attr("disabled","disabled");//增加无效
$("#EnvironmentSensorChange").removeAttr("disabled");//修改有效
$("#EnvironmentSensorInvalid").removeAttr("disabled");//失效有效
$("#EnvironmentSensorSave").removeAttr("disabled");//保存有效
EnvironmentSensorInputDisabled();//输入无效
$("#selectSensor_kind").val(objjson.sensor_kind);
$("#selectSensor_Interface").val(objjson.sensor_Interface);
$("#Sensor_brand").val(objjson.sensor_brand);
$("#Sensor_Supplier").val(objjson.sensor_Supplier);
$("#Sensor_tel").val(objjson.sensor_tel);
$("#sensor_KEY").val(objjson.sensor_KEY);
$("#environmentSensor_valid_Flag").val(objjson.environmentSensor_valid_Flag);
},
onUncheck:function(row){
initformEnrionmentSensor();
},
});
};
tableEnvironmentSensor = $('#environmentSensor_table').bootstrapTable({
method: 'get', //请求方式(*)
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: true, //是否显示分页(*)
sortable: false, //是否启用排序
sortOrder: "asc", //排序方式
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 6, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
clickToSelect: true,
showExport: true, //是否显示导出
singleSelect:true,
exportDataType: "basic", //basic', 'all', 'selected'.
columns: [
{
field : '',
title : '編號',
align:'center',
valign:'middle',
formatter : function(value, row, index) {
return index + 1;
}
},
{
checkbox: true
}, {
field: 'sensor_kind',
title: '傳感器種類',
align:'center',
valign:'middle',
}, {
field: 'sensor_Interface',
title: '接口類型',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'select',
title:'接口類型',
source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": v,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
}, {
field: 'sensor_brand',
title: '品牌型號',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'品牌型號',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": objjson.sensor_Interface,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":v,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
} ,
{
field: 'sensor_Supplier',
title: '供應商',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'供應商',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface":objjson.sensor_Interface,
"Sensor_Supplier":v,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":objjson.sensor_tel
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
} ,
{
field: 'sensor_tel',
title: '供應商電話',
align:'center',
valign:'middle',
sortable: true,
editable:{
type:'text',
title:'供應商電話',
//source:[{value:"IIC",text:"IIC"},{value:"UART",text:"UART"},{value:"1-Wire",text:"1-Wire"},{value:"SPI",text:"SPI"},{value:"Analog_Output",text:"Analog_Output"},{value:"Digital_Output",text:"Digital_Output"}],
validate: function (v) {
// alert(v);
var selectContent = table.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
// alert(JSON.stringify(selectContent));
//alert(objjson.eb_Key +" "+objjson.board_Name+" "+objjson.org_Id+" "+objjson.memo);
if(typeof(selectContent) == 'undefined') {
alert("未選擇");
return false;
}else{
if(window.confirm('确认修改?')){
$.ajax({
type : "POST",
url : "EnvironmentSensorModify",
dataType : "json",
data:{
"sensor_KEY": objjson.sensor_KEY,
"sensor_Interface": objjson.sensor_Interface,
"Sensor_Supplier":objjson.sensor_Supplier,
"Sensor_brand":objjson.sensor_brand,
"sensor_kind":objjson.sensor_kind,
"Sensor_tel":v
},
success : function(msg) {
$("#prompt_message").css({"color":"green",'fontWeight':'bold'});
$("#prompt_message").text("SUCCESS:修改的Key是"+msg.environmentSensorModifyFlag);
query();
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
},
error : function() {
$("#prompt_message").css({"color":"red",'fontWeight':'bold'});
$("#prompt_message").text("错误:修改失败");
clearInterval(inrobj);
inrobj=setInterval("clearMsg()",5000);
}
});
return true;
}else
{
window.location.Reload();
return false;
}
}
}},
}
],
formatLoadingMessage: function(){
return "";
},
onCheck:function(row){//选择table某一行
var selectContent = tableEnvironmentSensor.bootstrapTable('getSelections')[0];
var objjson = JSON.parse(JSON.stringify(selectContent));
//alert(objjson.sensor_KEY+" "+objjson.sensor_Interface+" "+objjson.sensor_Supplier+" "+objjson.sensor_brand+" "+objjson.sensor_kind+" "+objjson.sensor_tel);
$("#EnvironmentSensorClear").attr("disabled","disabled");//清除无效
$("#EnvironmentSensorAdd").attr("disabled","disabled");//增加无效
$("#EnvironmentSensorChange").removeAttr("disabled");//修改有效
$("#EnvironmentSensorInvalid").removeAttr("disabled");//失效有效
$("#EnvironmentSensorSave").removeAttr("disabled");//保存有效
EnvironmentSensorInputDisabled();//输入无效
$("#selectSensor_kind").val(objjson.sensor_kind);
$("#selectSensor_Interface").val(objjson.sensor_Interface);
$("#Sensor_brand").val(objjson.sensor_brand);
$("#Sensor_Supplier").val(objjson.sensor_Supplier);
$("#Sensor_tel").val(objjson.sensor_tel);
$("#sensor_KEY").val(objjson.sensor_KEY);
$("#environmentSensor_valid_Flag").val(objjson.environmentSensor_valid_Flag);
},
onUncheck:function(row){
initformEnrionmentSensor();
},
});
};
阅读全文
0 0
- bootstrapTable 修改栏位值
- attr()修改bootstrapTable自定义属性
- bootstrapTable
- SqlServer2008修改表栏位提示权限问题
- 如何修改Oracle数据表的栏位顺序
- android修改系统导航栏位置
- bootstrapTable 数据绑定和修改列
- BootstrapTable 特定列修改字体颜色
- SpringBoot+BootStrapTable+PageHelper用户新增,删除,修改
- 修改SQL数据库排序规则修改表栏位排序规则
- 窗体建立时,显示栏位Default值
- 利用template隐藏栏位0值
- bootstrapTable 单选及其取值
- struts页面无法保留栏位值的原因
- dataGridView增加栏位, 并且textbox 值输入到datagridview
- ASPxGridView根据栏位的值变更颜色,高亮显示
- bootstrapTable api
- bootstrapTable 举例
- 使用jQuery POST提交数据返回的JSON是字符串不能解析为JSON对象
- 动画中级
- 手动脱壳之PECompact
- mysql中的mysql.user表
- webview长按自由复制文字
- bootstrapTable 修改栏位值
- 如何判断网站是不是wordpress做的及WP主题是什么?
- 解决Session 'appname': Error Launching activity
- EventBus全解析
- 基于IMX6Q的XFM10621六麦驱动实现说明
- android 防快速点击的一种实现方式
- python 基础知识补充
- dentry与inode有什么联系和区别
- Android内存优化(使用SparseArray和ArrayMap代替HashMap)