Hi,
I’m trying to figure out using the jquery version how to make an ajax call to populate level2 of each of the items on my level 1 of my list. If I simply populate when the page loads it simply takes too long to get everything. If it made an ajax call to populate the selected level, then would be a lot less time for load.
Any idea??
$('#notifications').mobiscroll().listview({
enhance: true,
theme: 'ios',
itemGroups: {
level1: {
swipe: false
},
level2: {
stages: [{
percent: -25,
icon: 'link',
color: 'green',
text: 'View',
confirm: true,
action: function (event, inst) {
var id = event.target.getAttribute('data-id');
var type = event.target.getAttribute('type-id');
var slug = event.target.getAttribute('url-id');
window.location.href = '/dealboxx/mobile/sales/' + slug + '/' + id + '/' + type + '';
}
}, {
percent: 25,
color: 'red',
icon: 'remove',
text: 'Dismiss',
confirm: true,
action: function (event, inst) {
var id = event.target.getAttribute('appt-id');
var type = event.target.getAttribute('type-id');
$.ajax({
url: "/dealboxx/mobile/sales/" + type + "/" + id + "/dismiss",
type: 'GET',
dataType: 'json',
success: function (data) {
inst.remove(event.target);
}
});
return false;
}
}]
}
}
});