Please Log-in or Register to get full access to the forums.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qtip error message positioning within jquery ui accordion
22nd August, 11:34 (This post was last modified: 22nd August 11:36 by hellman666.)
Post: #1
qtip error message positioning within jquery ui accordion
Hi everyone,

For a project I am using the jQuery UI Accordion in combination with MVC4. Parts of a form are divided over several tabs within the accordion and I am using qtip to show validation errors on the fields that are not correctly filled with data.

Now everything works like a charm, except for 1 thing... when a qtip validation error is shown next to one of the form fields and I am collapsing one of the accordion tabs while this error message is active, then the qtip message does not move with the form field (that is changing position because of the accordion tab collapsing).

How can I make sure that a qtip error tooltip sticks to this input field? I want to have the qtip move with the form field.

I can't seem to figure it out :/

Best regards,
Martijn

edit: sorry, this post belongs in the qtip2 section in stead of qtip1.x :/
Find all posts by this user
Quote this message in a reply
10th December, 19:04
Post: #2
RE: qtip error message positioning within jquery ui accordion
I'm having the same trouble... qTip2 and jQueryUI Accordion. Collapsing the accordion doesn't impact the visible tooltips.

I'm searching thru the accordion docs to see if there's a way that i can fire a "destroy" on the tooltips on collapse, but so far I've not been able to get anything working.

Curious if anybody's run into this and possibly has a solution?
Find all posts by this user
Quote this message in a reply
11th December, 18:33
Post: #3
RE: qtip error message positioning within jquery ui accordion
(10th December 19:04)charliegriefer Wrote:  I'm having the same trouble... qTip2 and jQueryUI Accordion. Collapsing the accordion doesn't impact the visible tooltips.

I'm searching thru the accordion docs to see if there's a way that i can fire a "destroy" on the tooltips on collapse, but so far I've not been able to get anything working.

Curious if anybody's run into this and possibly has a solution?

Ended up adding the following to my accordion code:

JS Code
change: function( event, ui ) {
	// hide any visible tooltips
	$( "div[ id^=ui-tooltip- ]" ).hide();
 
	// for the newly expanded section, show any currently hidden tooltips
	var inputs = ui.newHeader.first().next( "div" ).find( "input,textarea" );
 
	$.each( inputs, function( index, value ) { 
			var this_id = $( value ).attr( "id" );
			$( "#ui-tooltip-" + this_id ).show();
			$( "#ui-tooltip-" + this_id ).children().show();
	});
}


We're still on jQuery UI 1.7, not sure that "change" is a valid event in 1.9, but this works for us for now.

On change, any visible tooltips are hidden. ui.newHeader is a reference to the section of the accordion that has been opened, so I loop over text inputs and textareas in that section, showing any tooltips that were previously hidden for that section.

Not 100% sure that the 2nd call to children() is done in the most efficient manner, but again, it works. Open to suggestions if there is a better way.[/code]
Find all posts by this user
Quote this message in a reply
12th December, 08:13
Post: #4
RE: qtip error message positioning within jquery ui accordion
If you know the selector that the qTip's are bound to, why not jsut call .qtip('hide') on it?
JS Code
activate: function(event, ui) {
	$('.selector', ui.oldPanel).qtip('hide');
}
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Possible Bug: Error with show/hide and mousing over overlapping divs asdexter 3 138 24th March 18:10
Last Post: asdexter
  Jquery draggable show qtip while being dragged iknowyou 0 153 28th February 04:11
Last Post: iknowyou
  [Solved] Qtip2 upgrade issues with jquery 2.0.1 version nicck 2 180 25th February 18:26
Last Post: Craig
  I donĀ“t get to run jQuery fullcalendar with qTip elby 0 200 10th February 12:03
Last Post: elby
  [Solved] expanding/shrinking a tooltip with jquery-ui gstaniak 0 438 7th January 13:44
Last Post: gstaniak
  [Solved] jQuery .each() not working, any other ways? xMoltenX 2 345 2nd January 09:07
Last Post: Craig
  [Solved] [IE] Error Message: Member not found. [/IE] hego555 6 2,733 30th December 14:55
Last Post: Craig
  [Solved] unknown error : api.set networker 3 398 9th December 20:44
Last Post: Craig
  [Solved] jQuery UI Datepicker inside the qTip rguerreiro 3 2,134 7th December 13:50
Last Post: Craig
  [Solved] Conflict with Jquery Isotope brianjohnsondesign 2 529 7th December 03:11
Last Post: brianjohnsondesign



User(s) browsing this thread: 1 Guest(s)