checkbox

PyQt allign checkbox and put it in every row

会有一股神秘感。 提交于 2019-12-19 11:43:11
问题 I'm trying to do this with the check-box. Sadly is made for C++ and any adaptation of the code for Python has the result this error: 'QWidget' object is not callable What I wanna to do is to add a check-box on each row, this is my code: pWidget = QWidget() pCheckbox = QCheckBox() pLayout = QVBoxLayout() pLayout.addWidget(pCheckbox) pLayout.setAlignment(Qt.AlignCenter) pLayout.setContentsMargins(0, 0 ,0, 0) pWidget.setLayout(pLayout) for char in accounts: for columnNumber in range

jQuery: Add values of checkboxes to input text field

£可爱£侵袭症+ 提交于 2019-12-19 11:35:14
问题 I'm trying to add the values of any checked checkbox to an input text field. Here's my fiddle: http://jsfiddle.net/Lf6ky/ $(document).ready(function() { $(":checkbox").on('click', function() { if ($(':checkbox:checked')) { var fields = $(":checkbox").val(); jQuery.each(fields, function(i, field) { $('#field_results').val($('#field_results').val() + field.value + " "); }); } }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <input type="text" id=

remember radio button selections

岁酱吖の 提交于 2019-12-19 11:34:58
问题 I have the following code that works perfectly. It allows the user to 'like' or 'dislike' each post with radio buttons. The checkboxes are switches that allow the user to show/hide all liked or disliked posts. The problem is, I need the page to remember the radio button selections when the user leaves and returns. Would this require cookies? If so, how do i implement it? <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Unhide on checkboxes/radio buttons<

How to obtain multiple Checkbox states from nested Recycler View?

[亡魂溺海] 提交于 2019-12-19 11:24:26
问题 I have multiple checkboxes (switches in my case), in a nested recycler view. It looks like the following : I want to be able to retrieve all switch states on this screen when the user goes back and be able to identify which one’s are set to true. For example, I’m looking to obtain something in a similar format to this: [Item 0, Sub Item 1, TRUE], [Item 0, Sub Item 2, TRUE], [Item 1, Sub Item 0, TRUE] , etc. My issue is that I’m not exactly sure how to store these switch states. I'm not sure

How do I make a CheckBox look like a RadioButton

核能气质少年 提交于 2019-12-19 11:16:34
问题 I wanna use a CheckBox but I want it to have the RadioButton chrome. What's the easiest way to do this? 回答1: public partial class RadioCheckBox : CheckBox {...} RadioCheckBox.xaml: <CheckBox x:Class="WpfApplication1.RadioCheckBox" ... xmlns:m="clr-namespace:WpfApplication1" > <CheckBox.Style> <Style TargetType="{x:Type m:RadioCheckBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type m:RadioCheckBox}"> <Grid> <RadioButton IsChecked="{Binding RelativeSource=

WinForms TreeView with both radios and checkboxes

て烟熏妆下的殇ゞ 提交于 2019-12-19 11:02:13
问题 I have a case where I would like TreeView to be able to show radio buttons on multiple root nodes, and checkboxes on their children. There would only be one level of children beneath any root node. The radios should also behave like a group, ie one root is selected and the others' radios deselect. I've been trying to fake it with images, but it doesn't look realistic. I originally had a listbox and a separate checkedlistbox, but the usability gods struck it down. Has anyone implemented this

Only one checkbox to be selected

Deadly 提交于 2019-12-19 10:51:29
问题 I would like to only have single checkbox selected at a time. My program reads from a textfile and creates checkboxes according to how many "answers" there are in the textfile. Does anyone know what is wrong with the code? public partial class Form1 : Form { string temp = "questions.txt"; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { StreamReader sr = new StreamReader(temp); string line = ""; List<string> enLista = new List<string>(); while (

Keeping radio/checkbox values on postback?

旧城冷巷雨未停 提交于 2019-12-19 10:24:14
问题 There's is something I don't get with ASP objects. I have a button in a update panel. On the same page, I have a checkbox, a radiobutton and a textbox (outside the update panel). When I click on my button, I access all those three objects. The textbox is able to keep the his text value. But the radio/checkbox always return false when I check there checked state. Of course, my form is more complicated than what I just said. It involves Javascript and usercontrols. I managed to use the Request

How to get all childs view in group with ExpandableListView

不问归期 提交于 2019-12-19 10:14:18
问题 I am using expandable list view with checkboxex. I need to check all child boxes when I check group checkbox. How to get all child views in group? public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); groupRow = vi.inflate(R.layout.season, parent, false); } else { groupRow = convertView; } TextView seasonTitle = (TextView) groupRow

Get checkbox's ID

ⅰ亾dé卋堺 提交于 2019-12-19 10:01:44
问题 I need to get the ID of checkboxes in a table in the <tbody> section. I have a live(click) function that I want to bring up a popup with the data that i want based in the id in the checkbox. I want to also allow the system, to have multiple checkboxes checked I want to be able to store the ids in a temp var and the use them as needed and get rid of them as I go though them. 回答1: Just get id with .attr : $("#container input:checkbox").attr("id") To get an array of checkboxes ids you might use