selectable

How to enable dblclick event on elements which was binded with JQuery UI Selectable plugin?

半城伤御伤魂 提交于 2019-12-18 06:07:30
问题 In my case,I have an UL with JQuery UI Selectable plugin applied,but at the same time ,I want the item witch was binded with selectable plugin was doing something when I double click this item.But it seems that the JQuery UI Selectable plugin had block the dblclick event . So,how can I make it work? E.g: <script> $(function() { $( "#selectable" ).selectable(); $( "#selectable" ).dblclick(function(){ // do something here }) }); </script> <ul id="selectable"> <li class="ui-widget-content">Item

jQuery Selectable Get Text Value

廉价感情. 提交于 2019-12-12 02:24:29
问题 I have an unordered list of items - this list could be hundreds of items long - and as the user clicks an item, I display their selections to the right of the options. I'm using a combination of jQuery selectable and sortable to do so (although I lose the sortable once an option is clicked), and the value that is displayed for the user is the index of the selected item. I want to display the text value of the line item for the user instead, but as expected, grabbing the text() value returns

Link doesn't work inside UI Selectable

£可爱£侵袭症+ 提交于 2019-12-05 03:41:18
these are the code from JQuery website and I rewrite the contents of one : <style> #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #FECA40; } #selectable .ui-selected { background: #F39814; color: white; } #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } </style> <script> $(function() { $( "#selectable" ).selectable(); }); </script> <div class="demo"> <ol id="selectable"> <li class="ui-widget-content"><a href="">link can not click</a></li> <li class="ui-widget

jQuery UI selectable - making multiple select default

谁都会走 提交于 2019-12-04 23:52:52
问题 I need to make multiple selection available by default, so the user doesn't have to hold ctrl. Would appreciate some help with this, thanks. 回答1: If you want to use selectable , you might want to use bind meta key with mousedown event. There's already a debate going down here , i just found when i googled. 回答2: $("#selectable").selectable(); $("#selectable").on("selectablestart", function (event, ui) { event.originalEvent.ctrlKey = true; }); 回答3: i needed something like it once. Here is a

Jquery UI SELECTABLE, how to select one item only?

最后都变了- 提交于 2019-12-03 00:52:58
is there any way to define that, only one item can be selected with jquery.selectable widget? Or i've to inmplement a workarround capturing events and manipulating by my self what happens? $("#myList li").click(function() { $(this).addClass("selected").siblings().removeClass("selected"); }); I expanded on Nirmal's answer to limit the mouse select case. Also, I feel that it is cleaner to use the selected option rather than a completely separate event handler. $("#selectable").selectable({ selected: function(event, ui) { $(ui.selected).addClass("ui-selected").siblings().removeClass("ui-selected"

How to select elements based on xy coordinates, not using mouse drag, with jquery?

好久不见. 提交于 2019-12-01 01:01:56
How to select elements based on XY coordinates and not with mouse drag with jquery? The jQuery plugin, as shown below, will select all elements which are (partially) at position >= x and >= y. (function($){ $.fn.filterXY = function(x, y){ return this.filter(function(){ var $this = $(this), offset = $this.offset(), width = $this.width(), height = $this.height(); return offset.left + width >= x && offset.top + height >= y; }); } })(jQuery); Examples: $("*").filterXY(0,0); $("div").filterXY(100, 0); Update: Plugin to filter all elements between x1 and x2 Demo: http://jsfiddle.net/yx4sN/7/

DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled, but I have already defined rowKey

懵懂的女人 提交于 2019-11-30 21:41:42
I've a selectable PrimeFaces 3.4.1 datatable: <p:dataTable value="#{projectAdminisrationMB.selectedUserMemberOfGroups}" var="group1" rowKey="#{group1.name}" selectionMode="single" selection="#{projectAdminisrationMB.selectedBelongToGroup}"> ... </p:dataTable> I'm getting this error: com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit Grave: javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled. But I have already set rowKey as per FacesException: DataModel must implement org.primefaces.model

How to select elements based on xy coordinates, not using mouse drag, with jquery?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 19:58:42
问题 How to select elements based on XY coordinates and not with mouse drag with jquery? 回答1: The jQuery plugin, as shown below, will select all elements which are (partially) at position >= x and >= y. (function($){ $.fn.filterXY = function(x, y){ return this.filter(function(){ var $this = $(this), offset = $this.offset(), width = $this.width(), height = $this.height(); return offset.left + width >= x && offset.top + height >= y; }); } })(jQuery); Examples: $("*").filterXY(0,0); $("div").filterXY

jQuery UI Selectable - unselect selected item on click

扶醉桌前 提交于 2019-11-30 11:49:56
问题 Does anyone know if there's a way to configure a jquery ui selectable element to unselect the selected element when you click it? Sort of like a toggle. If it's already selected, unselect it, otherwise do the default behavior. Thanks. 回答1: i'm very late in responding to your question, but let me just answer it anyway so that to keep it as a reference for others. $( ".selector" ).bind( "mousedown", function ( e ) { e.metaKey = true; } ).selectable(); this will allow the toggle behavior that

DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled, but I have already defined rowKey

淺唱寂寞╮ 提交于 2019-11-30 05:27:53
问题 I've a selectable PrimeFaces 3.4.1 datatable: <p:dataTable value="#{projectAdminisrationMB.selectedUserMemberOfGroups}" var="group1" rowKey="#{group1.name}" selectionMode="single" selection="#{projectAdminisrationMB.selectedBelongToGroup}"> ... </p:dataTable> I'm getting this error: com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit Grave: javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled. But I have