Soy un novato en este tema. Tengo div con algunos widgets de dojo dentro. Uso ajax para volver a cargar este div, pero después de esto mis widgets de dojo no se muestran. ¿Cómo puedo hacer que mi navegador vuelva a cargar los widgets después de la solicitud de ajax? No quiero volver a cargar toda la página.Recargar widgets de dojo después de la solicitud de ajax
Mi ajax vista parcial:
<div dojoType="dijit.layout.BorderContainer" gutters="true" id="borderContainerTwo">
<?php foreach($wynik as $row): ?>
<div dojoType="dijit.layout.ContentPane" region="center" splitter="false">
<p id="category"><img src="/photo/category/<?php echo $row->idPropozycji;?>.jpg" width="100" height="130" style="float: left;"></p>
<?php echo $row->opis; ?>
</div>
<div dojoType="dijit.layout.AccordionContainer" id="leftAccordion" region="leading" splitter="true">
<div dojoType="dijit.layout.AccordionPane" title="Title">
<h3><?php echo $row->nazwa2; ?></h3>
</div>
<div dojoType="dijit.layout.AccordionPane" title="Place">
<?php echo $row->place;?>
</div>
</div>
<?php endforeach;?>
</div>
Recargar jQuery guión:
// Functon to Show out Busy Div
function showBusy(){
$('#ajax-content').block({
message: '<h1>Wczytuje dane</h1>',
css: {border:'3px solid #FFF'}
});
}
function updatePage(html){
window.setTimeout(function(){
$('#ajax-content').html(html);
}, 2000)
}
$(document).ready(function() {
// $.AJAX Example Request
$('.ajax-pag > li a').live('click', function(eve){
eve.preventDefault();
var link = $(this).attr('href');
console.log(link);
$.ajax({
url: link,
type: "GET",
dataType: "html",
beforeSend: function(){
showBusy();
},
success: function(html) {
updatePage(html);
}
});
});
});
Recomiendo utilizar solo un marco a la vez. Considere usar xhrGet y xhrPost para solicitudes de Ajax. ¿Utiliza Firebug para la depuración? Recomiendo usarlo. – perissf