Page 1 of 1

Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 11:25 am
by Joe Bohen

Hi,

I am attempting to implement mobiscroll with custom wheels as in:

http://jsfiddle.net/kovlex/3bScd/9/

I get an error: Uncaught TypeError: Object [object Object] has no method 'scroller'

Is this not possible in Tiggzi.

Regards,
Joe


Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 12:04 pm
by Maryna Brodina

Hi Joe! Working on it...


Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 12:18 pm
by Maryna Brodina

We tested - it works. Please ensure you've added next resources:

http://demo.mobiscroll.com/Content/cs...
http://demo.mobiscroll.com/Content/js...


Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 1:19 pm
by Joe Bohen

Hi Marina,

I had uploaded the wrong version. With the correct version it now works perfectly. Apart from date values, I should probably be asking this elsewhere but you might be able to help. I have placed the mobiscroll datepicker in an input and set the date format to 'dd Dmm yy' this displays properly in the control but when a value is selected I get the value 'mm/dd/yyyy' I suppose I could grab the control updated event and parse the returned value but it would be easier if this could be set at load time.

Regards,
Joe
Image


Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 2:40 pm
by Michael4771079

Hi Joe,
i'm using mobiscroll,
the js on click to get date and time, the following code returns a date of
dd/mm/yy

hope this helps

codevar Date1 = Tiggr('Date1Val');
var selectedDate = Date1.scroller('getDate');
var m = (selectedDate.getMonth()+1 9) ? "" + (selectedDate.getMonth()+1) : "0" + (selectedDate.getMonth()+1),
d = (selectedDate.getDate() 9) ? "" + (selectedDate.getDate()) : "0" + (selectedDate.getDate()),
y = selectedDate.getFullYear();
var dateString = d + "/" + m + "/" + y;
localStorage.setItem('selectedDate', dateString);

var Time1 = Tiggr('Time1Val');
var selectedTime = Time1.scroller('getDate');
var h = (selectedTime.getHours() 9) ? "" + selectedTime.getHours() : "0" + selectedTime.getHours(),
m = (selectedTime.getMinutes() 9) ? "" + selectedTime.getMinutes() : "0" + selectedTime.getMinutes(),
s = (selectedTime.getSeconds() 9) ? "" + selectedTime.getSeconds() : "0" + selectedTime.getSeconds();
var timeString = h + ":" + m + ":" + s;
localStorage.setItem('selectedTime', timeString);code
/code/code


Mobiscroll Custom Control

Posted: Wed Mar 27, 2013 3:15 pm
by Joe Bohen

Hi Michael, Thanks for your code.