multi-select

How to use javascript or jQuery to quickly select a preset of multi-select listbox items?

若如初见. 提交于 2019-12-08 09:01:58
问题 So say my page has a list of indexes '1,3,4,5,9,12' and a multi-select listbox with 12 items in it. What's a fast way to use javascript to tell the listbox to multi-select all items at those indexes? How would this be done using jQuery? So for example if the user selects the 'caramel' preset associated with the 'candybar' listbox, it will select all the candy bars that have caramel... I think you get the idea. 回答1: This could do the trick: <select id="select" multiple="multiple"> <option

Javascript - Which event to use for multiselect change

蹲街弑〆低调 提交于 2019-12-08 07:59:56
问题 I'm using YUI as javascript framework, and can successfully react when the user changes the value of basic input fields, the reaction being to sent an Ajax query. However, I'm not so lucky with multiselect dropdown lists: listening to "change" would send my query each time the user adds/removes an item to his selection listening to "blur" requires the user to click elsewhere in order to loose the focus and send the query (not very usable), plus it would send the query if the user only scrolls

Kendo ui Multi Select Remove Selected element using value

余生长醉 提交于 2019-12-08 07:18:53
问题 I am using kendo ui multiple select http://demos.kendoui.com/web/multiselect/events.html i have this code var data = [ { text: "Africa", value: "1" }, { text: "Europe", value: "2" }, { text: "Asia", value: "3" }, { text: "North America", value: "4" }, { text: "South America", value: "5" }, { text: "Antarctica", value: "6" }, { text: "Australia", value: "7" } ]; var multi = $("#select").kendoMultiSelect({ dataTextField: "text", dataValueField: "value", dataSource: data }).data(

jQuery UI Multiselect Widget With Images (Eric Hynds Version)

拥有回忆 提交于 2019-12-08 06:40:36
问题 The excellent dropdown jQuery UI Multiselect widget that supports styling via jQuery UI Themeroller still doesn't have support for including images within the drop down rows. I didn't see any answers to this problem within Stackoverflow yet it seems to be asked regularly in various areas of the internet, so I am giving the answer to this question below.. 回答1: (ALSO See my FIDDLE Example to see this in action,) The following is based on an initial idea by 'pdlove' for introducing the use of

asp.net mvc ListBoxFor - MultiSelectList does not apply the selected item

十年热恋 提交于 2019-12-08 06:02:10
问题 The tags are multi-selectable and are retrieved from the database. This is my action in the controller : public ActionResult EditDocument(long documentId, string returnURL) { ViewBag.returnURL = returnURL; int userId = AccountController.GetLoggedInId(Session); string pageUrl = "Document/EditDocument"; if (IsDocumentAccessible(documentId,pageUrl) && CheckOperation("EditDocument",pageUrl)) { try { spGetDocumentById_Result found = db.spGetDocumentById(documentId).ToArray()[0];

Multiselect, Jquery: Check my multiple select if at least one options should be selected

一曲冷凌霜 提交于 2019-12-08 04:50:26
问题 Hi I will summarize my problem I hope you would understand. Main Goal: To check if at least one of the options is selected before hitting the select button. else, If select button is clicked without choosing at least one options, it will show a message of "Please choose at least one options". Purpose: I have reasons in my other codes that needed a select button instead of just selecting multiple selects and doesn't need a button. The form looks like this: SIMPLE HTML CODE: <div class="form

Magento Saving Multiselect Array on Custom Model

点点圈 提交于 2019-12-08 04:46:28
问题 I have create a custom model in Magento which can get to and edit in the admin. I'm having trouble dealing with array's however. When I go to save the model, the text field saves fine, but the multiselect field just saves as 'array' and I'm then unable to go and edit it. I need to know how to save and retrieve this array data within the model. The array of data that shows in the multiselect field in simply filtered product data. Can anybody help with this? Any help much appreciated!!! 回答1:

Javascript functions don't work in IE8 when passed as parameters

∥☆過路亽.° 提交于 2019-12-08 04:37:43
问题 We're using jQuery UI MultiSelect widget on our website for various fields. For consistency we use it even for non-multi selects. The example code we use is: jQuery('#model').multiselect({ multiple : false, minWidth : 'auto', height : 'auto', header : false, selectedText: multiselect_set_label, open : multiselect_fit_widget, close : multiselect_free_keyboard, create : multiselect_fit_label, beforeopen : multiselect_bold_options }); Its not completely same everywhere, so we can't have just one

asp.net jqGrid dropdown multiselect

拥有回忆 提交于 2019-12-08 04:36:07
问题 i'm trying to use jQuery multiselect plugin in a form editing jqGrid (add form). This is the code ( colModel extract) I'm using to build the dropdown: { name: 'CaratteristicheCamera', index: 'CaratteristicheCamera', width: 50, hidden: true, edittype: 'select', editable: true, editrules: { edithidden: true, required: true }, editoptions: { multiselect: true, dataUrl: '<%# ResolveUrl("~/Service/Domain/ServiceRoom.asmx/GetRoomFeatureList") %>', buildSelect: function (data) { var retValue = $

Magento Saving Multiselect Array on Custom Model

邮差的信 提交于 2019-12-08 03:27:26
I have create a custom model in Magento which can get to and edit in the admin. I'm having trouble dealing with array's however. When I go to save the model, the text field saves fine, but the multiselect field just saves as 'array' and I'm then unable to go and edit it. I need to know how to save and retrieve this array data within the model. The array of data that shows in the multiselect field in simply filtered product data. Can anybody help with this? Any help much appreciated!!! Figured it out - on the saveAction() of your controller, underneath this: $data = $this->getRequest()->getPost