Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

VanillaJS Datepicker in subform Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
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: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 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.
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
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: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: VanillaJS Datepicker in subform

Unread post by kev1n »

Fix is on Github now.
Post Reply