multi-select

Swift - Save checkmarks selected in TableView

南笙酒味 提交于 2019-12-03 21:16:45
I am fairly new to Swift and I am having an issue on TableView multi-selection. I have multiple selections that I can check with a checkmark, similar to to-do list. When I check the items I want to be able to come back to the ListView and have my selections saved. I'm assuming that the code to keep this in saved state would go somewhere here? This is the class where the individual cell item checkmark is written : class ListItem: NSObject { let itemName: String var completed: Bool init(itemName: String, completed: Bool = false) { self.itemName = itemName self.completed = completed } } Can

Multiselect Box with Optgroups: Select one per group

假如想象 提交于 2019-12-03 14:38:56
I have a selectbox with the multiple attribute set. I'm also using <optgroup> tags to separate categories within my select box. I'm looking for a way, using either javascript or jQuery, to have the various options within each group to behave with 'radio button logic' rather than 'check box logic'. For example: <optgroup label="cat1"> <option>item 1.1</option> <option>item 1.2</option> </optgroup> <optgroup label="cat2"> <option>item 2.1</option> <option>item 2.2</option> </optgroup> User selects item 1.1 in the list. item 1.1 is selected as expected. User selects item 2.1 in the list. Now both

Multiselect two-column transfer widget with Twitter bootstrap theme

血红的双手。 提交于 2019-12-03 12:25:41
问题 I am looking for a multi-select jquery based two-column transfer widget having a look and feel compatible with twitter bootstrap. Typically transfer select widgets have two adjacent columns where the user moves his selections from one column to the other in both directions. I've searched really hard but couldn't find anything remotely close to my needs. Can anybody suggest something (short of writing one from scratch). Thanks. 回答1: I decided finally to write my own from scratch. The source

HTML5 multiselect dropdown with checkboxes plugin. Designed as standard <select> dropdown

人盡茶涼 提交于 2019-12-03 11:33:46
问题 I have been looking around all day after a good multiselect plugin looks as the same as a standard dropdown control. I have tried using jQuery UI MultiSelect Widget created by ehynds, dropdown-check-list and jQuery MultiSelect created by A Beautiful Site. These are really good plugins but I really want to use a plugin that have the same appearence as a standard dropdown in html5. Hope I make any sence! Have a nice day! // Solution 回答1: Bootstrap Multiselect - http://davidstutz.github.io

How can a multi-select-list be edited using asp.net mvc?

痞子三分冷 提交于 2019-12-03 08:19:47
问题 I'd like to edit an object like the one below. I'd like the UsersSelectedList populated with one or more Users from the UsersGrossList. Using the standard edit-views in mvc, I get only strings and booleans (not shown below) mapped. Many of the examples I find on google utilizes early releases of the mvc framework whereas I use the official 1.0 release. Any examples of the view is appreciated. public class NewResultsState { public IList<User> UsersGrossList { get; set; } public IList<User>

WooCommerce Custom Fields - Multiselect

点点圈 提交于 2019-12-03 01:03:00
I'm adding extra fields to the checkout page in WooCommerce, I can add basic fields like a text box, but need to add a (multi) select box, where the user can choose multiple items. I've figured out how to add a select box through code, like this: add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; woocommerce_form_field( 'my_field_name', array( 'type' => 'select', 'class' => array('my-field-class form-row-wide'), 'label' => __('Fill in this field'),

bootstrap multiselect get selected values

和自甴很熟 提交于 2019-12-02 18:01:03
How do I get back on onChange all selected values in my multiselect dropdown. Used plugin here . Trying to use the following but I think I'm on the wrong track $('#multiselect1').multiselect({ selectAllValue: 'multiselect-all', enableCaseInsensitiveFiltering: true, enableFiltering: true, maxHeight: '300', buttonWidth: '235', onChange: function(element, checked) { var brands = $('#multiselect1 option:selected'); var selection = []; $(brands).each(function(index, brand){ selection.push(brand); }); console.log(selection); } }); found it $('#multiselect1').multiselect({ selectAllValue:

Multi select PHP

一个人想着一个人 提交于 2019-12-02 16:55:34
问题 <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <select name="test[]" multiple="multiple"> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> <option value="five">five</option> </select> <input type="submit" value="Send" /> </form> <?php $test=$_POST['test']; if ($test){ foreach ($test as $t){echo 'You selected ',$t,'<br />';} } if($t=='one') $price1=12; if($t=='two') $price2=2; $total = $price1 +

HTML Mutli Select Not Posting Values Back to PHP

。_饼干妹妹 提交于 2019-12-02 15:55:45
问题 I have a select box in a html form that does not post values back to php. <select multiple='multiple' name='mydropdown'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> in PHP if I have a look at the $_REQUEST it returns a single value for the LAST selected value in the select box. What do I need to change or edit in order to get a array or list of selected items posted back so that I can handle the result in PHP? I would like to transform the

grails multiple select: values are not stored in related object

孤人 提交于 2019-12-02 15:28:35
问题 I have a multiple select as follows: <g:select name="receiptItems" from="${HealthService.findAllByDoctor(Doctor.findBySecUser(new ReceiptController().getCurrentlyLoggedUser()))}" multiple="multiple" optionKey="id" optionValue="${{it.healthServiceType.healthService}}" size="5" value="${receiptInstance?.healthServices*.id}" class="many-to-many" onchange="${remoteFunction( controller: 'Receipt', action: 'sumReceiptItems', params: '\'receiptItemsSelected=\' + jQuery(this).val()', onSuccess: