selected

MvxListView checkable list item

陌路散爱 提交于 2019-12-07 13:32:14
问题 I wanted to get the CustomChoiceList to work with MvvmCross, but was struggling getting the sample working, the ListItem wouldn't get selected. In fact the sample uses a custom LinearLayout that extends LinearLayout and implements ICheckable. When using the same layout with a MvxAdapter and an MvxListView the method OnCreateDrawableState is never called and the text and selection icon are never high-lighted. I'm aware that the selected item could be stored in the ViewModel. Here is the

Function to check if the db value matches the current Select option

风格不统一 提交于 2019-12-07 12:49:57
问题 I am creating a customer account page which displays the relevant information in the database and allows customers to edit their information. The code below retrieves and displays the customer's account information from the database and pre-selects the values matching their information, but since there are a few hundred select and/or multiselect elements I'd like to create a function which would check if the db value (i.e. $rows['gift_privacy'] ) matches the current option. <?php try { $stmt

Jquery binding event on selected class

六月ゝ 毕业季﹏ 提交于 2019-12-07 05:15:32
问题 Is it achievable in jquery to bind an event to a group of control that has certain class? It seems to me, it can't. I google a bit and all that came up are nothing to do with events. Here's how my code looks - $('.numonly').bind('keypress',function(event){ if (event.which > 31 && (event.which < 48 || event.which > 57)) return false; }); 回答1: Your code should work, here's an example of it in action: http://jsfiddle.net/g3GsE/ Make sure that your code is wrapped like this so it doesn't execute

Add selected attribute to option in select menu with jQuery

你说的曾经没有我的故事 提交于 2019-12-07 00:26:29
问题 I'm making a select menu plugin to replace the ugly default selects and be consistent across different OS. Here's the demo (only firefox and webkit) http://spacirdesigns.com/selectMenu/ It's already working, but I'm having problems assigning the "selected" attribute to the option. The code works with any other attribute but I can't get it to work with the selected attribute. This works: select.find('option') .removeAttr('whatever') .eq(index).attr('whatever', 'hello'); This doesn't: select

jQuery Hide / Show input when selected option is equal to

喜你入骨 提交于 2019-12-06 14:08:13
问题 If selected option is equal to 2, I want to add the following line to the body: <input id="fnivel2" pk="1"/> I did it using a hide class. It works but I'm not sure if it is a correct solution: <script> $(document).ready(function (){ $("#fnivel").change(function(){ var selected_option = $('#fnivel').val(); if(selected_option == '2'){ $("#fnivel2").removeClass("hide"); $("#fnivel2").attr('pk','1'); } if(selected_option != '2'){ $("#fnivel2").addClass("hide"); $("#fnivel2").removeAttr('pk'); } }

How to maintain selected rows in DataGridView when mouse is held down on a cell?

若如初见. 提交于 2019-12-06 07:05:40
问题 I am trying to implement row moving in a DataGridView. I want to be able to select multiple rows and click on any of the selected row's cells to begin the drag operation. The problem is that the rows become deselected when I hold the mouse down on a cell. How can I prevent this from happening? 回答1: From a quick Google search, this seems to a solution for custom drag-dropping of rows. Note I just ripped the following code from the linked page, I can't vouch for its effectiveness. private

Move Up, Move Down Buttons for ListBoxes in Visual Studio [duplicate]

半城伤御伤魂 提交于 2019-12-06 03:34:44
This question already has an answer here: How to move item in listBox up and down? 15 answers I am trying to make a Move Up Button, and a Move Down Button, to move a selected item in a ListBox in Microsoft Visual Studio 2012. I have seen other examples in WDF, jquery, winforms, and some other forms but I haven't seen examples from Microsoft Visual Studio yet. I have tried something like this: listBox1.AddItem(listBox1.Text, listBox1.ListIndex - 1); But Microsoft Visual Studio didn't have an "AddItem" property in their ListBoxes. For more information, I have two listboxes that I want to make my

MvxListView checkable list item

北城余情 提交于 2019-12-06 03:26:36
I wanted to get the CustomChoiceList to work with MvvmCross, but was struggling getting the sample working, the ListItem wouldn't get selected. In fact the sample uses a custom LinearLayout that extends LinearLayout and implements ICheckable. When using the same layout with a MvxAdapter and an MvxListView the method OnCreateDrawableState is never called and the text and selection icon are never high-lighted. I'm aware that the selected item could be stored in the ViewModel. Here is the original sample: https://github.com/xamarin/monodroid-samples/tree/master/CustomChoiceList In fact the

How to set multiple items as selected in ListBox?

放肆的年华 提交于 2019-12-06 02:57:35
问题 I have one ListBox with selection mode of multiple. In code behind, I want to set some values as selected. These values are present in a ListItems[] named 'Names' . HTML code: <asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Multiple"> <asp:ListItem>Mandy</asp:ListItem> <asp:ListItem>Amit</asp:ListItem> <asp:ListItem>sundar</asp:ListItem> <asp:ListItem>ragu</asp:ListItem> <asp:ListItem>raju</asp:ListItem> </asp:ListBox> ListItem[] Names contains

Xcode: set image on button only for default state, not also selected

这一生的挚爱 提交于 2019-12-05 17:06:26
I am new to Xcode and iPhone programming in general.. I have a simple problem thats bugging me.. I want to set an image on a button, for it's default state. So I select the button, and in the "Show the attributes inspector"-tab, I select "state config" to be default, then I find the desired image in "image"-drop down list... Problem: I change the "state config" to selected, and the image is still on. I need the image to only be on in default state. I have same problem if i want different font size of the title text in default- and selected-state. I'm using Xcode 4.6 and writing for iOS 6.1.