如何维护radiobutton列表项值的先前值以便更新jqurey crud操作中的值 [英] How to maintain previous value of radiobutton list item value inorder to update the value in jqurey crud operations

查看:76
本文介绍了如何维护radiobutton列表项值的先前值以便更新jqurey crud操作中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我更新数据时,没有检查listitem的私密值。请给我发送代码



我试过的:



var FStatus = [];

$ .ajax({

类型:POST ,

contentType:application / json; charset = utf-8,

url:WebForm1.aspx / FillTable,

数据:{},

dataType:json,

成功:功能(数据){





for(var i = 0; i< data.d.length; i ++){



var status = data。 d [i] .FeatureStatus;

FStatus.push(状态);

}

}

}) ;点击编辑按钮时


if(FStatus [i] == Active){



$( #RadioButtonList1)。val(1);

}

else {

$(#RadioButt onList1)。val(0);

}

请注意这里我采取的是积极的

when i am updateting the data the privious value of listitem is did not checked.please send me code for that

What I have tried:

var FStatus = [];
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm1.aspx/FillTable",
data: "{}",
dataType: "json",
success: function (data) {


for (var i = 0; i < data.d.length; i++) {

var status = data.d[i].FeatureStatus;
FStatus.push(status);
}
}
});
when edit button clicked
if (FStatus[i] == Active) {

$("#RadioButtonList1").val("1");
}
else {
$("#RadioButtonList1").val("0");
}
note here i am taking true as active

推荐答案

.ajax({

type:POST,

contentType:application / json; charset = utf-8,

url:WebForm1.aspx / FillTable,

数据:{},

dataType: json,

成功:功能(数据){





for(var i = 0; i< data.d.length; i ++){



var status = data.d [i] .FeatureStatus;

FStatus。推(状态);

}

}

});

点击编辑按钮时

if(FStatus [i] == Active){


.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm1.aspx/FillTable",
data: "{}",
dataType: "json",
success: function (data) {


for (var i = 0; i < data.d.length; i++) {

var status = data.d[i].FeatureStatus;
FStatus.push(status);
}
}
});
when edit button clicked
if (FStatus[i] == Active) {


(#RadioButtonList1)。val(1 );

}

else {
("#RadioButtonList1").val("1");
}
else {


(#RadioButtonList1)。val(0);

}

请注意这里我采取的是积极的
("#RadioButtonList1").val("0");
}
note here i am taking true as active


这篇关于如何维护radiobutton列表项值的先前值以便更新jqurey crud操作中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆