Page 2 of 3

how to delete a selected item from seletmenu1, populated from array

Posted: Thu Nov 29, 2012 3:12 pm
by Kateryna Grynko

We cannot reproduce your problem. Which Android version do you use?


how to delete a selected item from seletmenu1, populated from array

Posted: Thu Nov 29, 2012 3:29 pm
by Michael4771079

galaxy ace (GTS5830)


how to delete a selected item from seletmenu1, populated from array

Posted: Thu Nov 29, 2012 3:30 pm
by Michael4771079

2.3.6


how to delete a selected item from seletmenu1, populated from array

Posted: Thu Nov 29, 2012 3:58 pm
by Kateryna Grynko

I see. It's a bug. We will fix it. I will update.


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 11:32 am
by Kateryna Grynko

It's an Android feature. To get over it use this JS code to add elements instead of existing code:
codefunction setSelectMenuOptions(select, options) {
select.children().each(function() {$(this).remove()});
for(i=0; i<options&#46;length; i++) {
var value = options;
var newOption = $('<option value="'+value+'">'+value+'<&#47;option>');
select&#46;append(newOption);
}
select&#46;refresh();
}

function save(item, varName) {
var arr = localStorage&#46;getItem(varName);
if(arr == null) {
arr = new Array();
}
else {
arr = JSON&#46;parse(arr);
}
arr&#46;push(item);
localStorage&#46;setItem(varName, JSON&#46;stringify(arr))
}

function myload(varName) {
var arr = localStorage&#46;getItem(varName);
if(arr == null) {
arr = new Array();
}
else {
arr = JSON&#46;parse(arr);
}
return arr;
}/code


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 11:38 am
by Michael4771079

thanks Katya,
will this new code work with both ios and android, or do I keep old code for iphone


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 11:46 am
by Kateryna Grynko

It must be working. I'll test.


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 2:28 pm
by Kateryna Grynko

It works with iPhone.


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 2:59 pm
by Michael4771079

thanks ever so much, perfect, 1 other thing, I needed to set the date on load to show todays date, is there a script for this,

thanks Katya, you have been fantastic!


how to delete a selected item from seletmenu1, populated from array

Posted: Fri Nov 30, 2012 4:00 pm
by Kateryna Grynko

You can run this JavaScript code to set current date in Datepicker:
code
var datepicker = Tiggzi('mobiledatepicker1_2');
var dateFormat = datepicker&#46;attr('dateFormat');
var currentDate = $&#46;datepicker&#46;formatDate(dateFormat, new Date());

datepicker&#46;attr('defaultDateValue', currentDate);
/code
Insert your DatePicker component name instead of 'mobiledatepicker1_2' if it differs.