jquery-ui

Always show a specific choice in jQuery Autocomplete even if it doesn't match input

安稳与你 提交于 2020-02-13 16:35:32
问题 I have a jQuery autocomplete (jquery ui version 1.8) in which I type a name. When available, I want the user to select a name from the list as these are owner names from our database. However, there is the occassion where they will need to add a new owner name, and in this instance, I want them to chose "Add New" from the autocomplete's drop down list. The problem is, if I include "Add New" as a choice in my autocomplete source data, it does not show up as a choice in the autocomplete drop

Always show a specific choice in jQuery Autocomplete even if it doesn't match input

淺唱寂寞╮ 提交于 2020-02-13 16:34:53
问题 I have a jQuery autocomplete (jquery ui version 1.8) in which I type a name. When available, I want the user to select a name from the list as these are owner names from our database. However, there is the occassion where they will need to add a new owner name, and in this instance, I want them to chose "Add New" from the autocomplete's drop down list. The problem is, if I include "Add New" as a choice in my autocomplete source data, it does not show up as a choice in the autocomplete drop

jquery-ui sortable - programmatically set item being dragged

强颜欢笑 提交于 2020-02-08 07:52:07
问题 I have a list of items I want to make sortable. I would like to make that list scrollable, but at the same time I want the handle to pop out to the side of the list. When clicking on an list item, I can have the pop out show outside the list (at this point, I know which li they have selected), and when they mousedown on a button in the popout, I create the sortable. Can I create the sortable with the current li as the item being dragged? The core issue here that I'm trying to work around is

jquery-ui sortable - programmatically set item being dragged

为君一笑 提交于 2020-02-08 07:52:05
问题 I have a list of items I want to make sortable. I would like to make that list scrollable, but at the same time I want the handle to pop out to the side of the list. When clicking on an list item, I can have the pop out show outside the list (at this point, I know which li they have selected), and when they mousedown on a button in the popout, I create the sortable. Can I create the sortable with the current li as the item being dragged? The core issue here that I'm trying to work around is

How do I discover all available properties when using a jQuery UI widget?

∥☆過路亽.° 提交于 2020-02-08 03:13:33
问题 I have recently found that there are additional properties for some jQuery UI widgets that work, but are not documented. For example, when providing the buttons property on a jQuery UI 1.11.4 dialog box, I can use sub-properties like id and autofocus , neither of which are listed in the official documentation. $("#myDialog").dialog({ title: "Do the thing?" buttons: [ { text: "Yes", id: "dialogBtnYes", click: function () { $(this).dialog("close") } }, { text: "No thanks", id: "dialogBtnNo",

Custom text on jquery ui datepicker event

拈花ヽ惹草 提交于 2020-02-07 19:52:09
问题 I'm receiving an array from a database with some dates and a description for each day. I wish to display a jquery datepicker calendar where the specified dates are displayed with a custom css class. Besides that the user should be able to click on the specific date and get the description displayed in a different div element. The first part with the css class is working, but I can't get the description to display. This is what I have so far: var Event = function(text, className) { this.text =

Alternatives to trigger('mouseup') to stop dragging programmatically

可紊 提交于 2020-02-06 18:59:30
问题 As it seems like I have found a bug in jquery: jquery draggable throws error when 'mouseup' is triggered Can I get some advice on how to implement the following functionality without using the trigger? I want to be able to stop an element to be dragged when a condition has been reached, I have been trying lot's of possibilities but none works automatically, even though the event is fired when condition is true it only takes effect when you "mouseup" the dragger. I'm really trapped on this,

how to get clicked element text using jQuery?

给你一囗甜甜゛ 提交于 2020-02-06 08:40:28
问题 I want to get the text of clicked element in an alert of jQuery. See example below https://jsfiddle.net/pymd4n04/2/ jQuery(".results").click(function() { event.preventDefault(); jQuery(this).find('h3').click(function() { var text = jQuery(this).text(); console.log(text.trim()); alert(text.trim()); }); }); But when I click first time, empty alert is shown and when I click 2nd the value is shown but twice alert. and keep increment alerts. Any help would be appreciated. Thanks in advance 回答1:

Dynamically bind error message along with a icon to a single jQuery dialog

£可爱£侵袭症+ 提交于 2020-02-06 08:03:13
问题 I have created a global jQuery dialog to display all error messages in the application. I am able to bind the error message to the dialog, however I am unable to show the icon along with. For sake of simplicity I have provided a sample with a generic google image. Any leads will be appreciated or if there's a better way to do it please do mention. Thanks in advance function showAlertDialog(message) { var $dialog = $('#ErrorMessageDialog') .html(message) .dialog({ modal: true, title: 'Data

Dynamically bind error message along with a icon to a single jQuery dialog

廉价感情. 提交于 2020-02-06 08:03:10
问题 I have created a global jQuery dialog to display all error messages in the application. I am able to bind the error message to the dialog, however I am unable to show the icon along with. For sake of simplicity I have provided a sample with a generic google image. Any leads will be appreciated or if there's a better way to do it please do mention. Thanks in advance function showAlertDialog(message) { var $dialog = $('#ErrorMessageDialog') .html(message) .dialog({ modal: true, title: 'Data