I get a little mad because i do not find the hint: I ve a collapsible set, wich is created dynamic from a database, which shows me some dates. Then i want to fill content to the collapsibles, which should be also a collapsible(this present some details, of the specific day) This content is coming of another ajaxcall (getDaydata(gotDate)) which is working. But if i click to expand the subset (the dateget-content-collapsible class) the ajax call is fired twice, and the append kills the layout. So how can i prevent this second event to be fired up? Thanks for the help. Klaus
$('#home').live('pagebeforecreate',function(event, ui){
countview = 7;
getPersons(countview);
});
getPersons(countview);
});
$('.dateget-headline').live('expand', function(){
var str=this.id;
var gotDate=str.substring (8,18);
getDaydata(gotDate);
});
function getPersons(countstand)
{
$.ajax({
url: 'fllist1.php',
type: 'GET',
data: {countitems: countstand},
dataType: "json",
success: function (data) {
$.each(data, function(i,Person)
{
$('<div/>', {
'id': 'dateget-'+Person.dataget+'-collapsible',
'data-role':'collapsible',
'class':'dateget-headline',
'data-collapsed':'true',
}).appendTo('#main-content-list');
$('#dateget-'+Person.dataget+'-collapsible').html('<h5>'+ Person.dataget +'</h5>');
$('.datelist').collapsible();
//create a new collapsible set inside the collabsible
$('<div/>', {
'id': 'dateget-'+Person.dataget+'-collapsible-set',
'data-role':'collapsible-set',
'class':'dateget-content-collapsible-set',
'data-theme':'c',
'data-content-theme':'d',
}).appendTo('#dateget-'+Person.dataget+'-collapsible');
$('.dateget-headline').collapsible();
});
}
});
};
function getDaydata(gotDate){
var gotDate=getDaydata.arguments[0];
$.ajax({
url: 'getDatedetails.php',
type: 'GET',
data: 'detailday=' + gotDate,
dataType: "json",
success: function (data) {
$.each(data, function(i,Fldet){
$('<div/>', {
'id': 'dateget-'+Fldet.id+'-collapsible',
'data-role':'collapsible',
'class':'dateget-content-collapsible',
'data-collapsed':'true',
}).appendTo('#dateget-'+gotDate+'-collapsible-set');
$('#dateget-'+Fldet.id+'- collapsible').html('<h1>'+Fldet.reg+'</h1>'+Fldet.call+Fldet.arrtt+Fldet.dept );
});
$('.dateget-content-collapsible').collapsible();
},
}
});
};
here you can see the script in action: http://nixnutz.info/lowimobil2.php