function click1(a)
{
var srcdivid =$(a).closest('div').attr('id');
$("#pagetemplate").dialog("open"); return false;
}
Here I get the value srcdivid and i hav to pass this value to above dialogue.how its possible?
My dialogue widget code is following
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'pagetemplate',
'options'=>array(
'title'=>'Page Template',
'autoOpen'=>false,
'modal'=>true,
'width'=>1000,
'height'=>300
),
));?>
<input type="hidden" name="padeidvalue" id="padeidvalue">
<?php if(count($templatemodel) > 0){
for($i=0;$i<count($templatemodel);$i++){
echo "<div class='temp-thumb'><a class='".$templatemodel[$i]['template_image_name']."' onclick='addtemplate(".$templatemodel[$i]['page_template_id'].");' href='#'></a></div>";
}
}else{
echo "<p>Opps!. No Templates Found></p>";
}?>
<?php $this->endWidget('zii.widgets.jui.CJuiDialog');?>
Here I call the addtemplate function. Its definition as follows
function addtemplate(params){
var srcdivid ="";
alert(srcdivid);
alert(params);
$.ajax({
url:baseURL+"/index.php/MyAlbums/AddTemplatesToDiv",
type:'POST',
data:{"templateid":params,"divid":"srcdivid" },
success:function(data){
$("#"+srcdivid).html(data.template);
$("#pagetemplate").dialog("close");
$(".imgborderclass").removeClass("imgborderclass");
addClass();
addComm();
},
});
}
I have to get srcdivid in this addtemplate function which i pass from click function. help me please..