Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

VanillaJS Datepicker in subform Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
vario
Posts: 154
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 2 times
Been thanked: 1 time

VanillaJS Datepicker in subform

Unread post by vario »

I have a subform with date fieldsthat occupies a narrow portion of the form, and the new datepicker is not visible when in the last row (at bottom of subform). I have to scroll down after I've clicked on the date field in order to see the picker. Can it be made to display "always on top"?
steven
Posts: 418
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 59 times
Been thanked: 55 times

Re: VanillaJS Datepicker in subform

Unread post by steven »

vario,

Is this what you mean?

bef.png


And you want this?

aft.png

Until this is updated on GitHub you can add this to nuBuilder's JavaScript in nuform.js ...


fixed.png

Code: Select all

	setCalendarTop();

}

function setCalendarTop(){

	var $innerDiv = $('.datepicker');
	var offset = $innerDiv.offset();

	// Move the div to the body
	$innerDiv.appendTo('body');

	// Apply the position
	$innerDiv.css({position: 'absolute', top: offset.top, left: offset.left});
	
}


Steven
You do not have the required permissions to view the files attached to this post.
A short post is a good post.
Buy Kev a Coffee
vario
Posts: 154
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 2 times
Been thanked: 1 time

Re: VanillaJS Datepicker in subform

Unread post by vario »

Yes thanks, that's exactly what I wanted.
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: VanillaJS Datepicker in subform

Unread post by kev1n »

Fix is on Github now.
Post Reply