我在Windows窗体应用程序中使用CheckBoxList,并尝试为其应用数据源.
有一个DataTable,"DT",以列id,name并且ischecked,我用这样的代码:
((ListBox)MyCheckBoxList).DataSource = dt;
((ListBox)MyCheckBoxList).DisplayMember = "name";
((ListBox)MyCheckBoxList).ValueMember = "id";
Run Code Online (Sandbox Code Playgroud)
如何为MyCheckBoxList中的所有项设置CheckState?
我将此值保留在我的数据表中,并希望将它们与MyCheckBoxList链接.
我解析http响应有问题.我尝试向客户端发送一些值
>>>>return HttpResponse(first=True,second=True)
解析时:
$.post('get_values',"",function(data){
alert(data['first']); //The alert isn't shown!!!
});
Run Code Online (Sandbox Code Playgroud)
从httpresponse中提取值的正确方法是什么
也许我在创建我的回复时犯了一个错误..
如果列表是动态创建的,如何获取可选列表中项目的"id"?
<ul id="selectable">
<li id='1'>..</li>
.
.
<li...
</ul>
Run Code Online (Sandbox Code Playgroud)
我试过var num = $('#selecable :selected').attr( "option" , 'id' );但只得到[对象] ...
什么是正确的方法?
jquery ×2
c# ×1
checkboxlist ×1
datasource ×1
django ×1
get ×1
httpresponse ×1
selectable ×1
winforms ×1