Created
March 27, 2013 11:10
-
-
Save jackkitley/5253431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myvar; | |
function doDamage(element) | |
{ | |
console.log("TYPE:"+typeof element); | |
myvar = element; | |
vehicletypesideareaid = myvar.vehicletypesideareaid; | |
var url = '<?php echo Yii::app()->createUrl("vehicle/DamageForm"); ?>' + '&vehicleid=<?php echo $vehicleid?>&vehicletypesideareaid='+vehicletypesideareaid; | |
<?php echo CHtml::ajax(array( | |
'url'=>'js:url', | |
'data'=> "js:$(this).serialize()", | |
'type'=>'post', | |
'dataType'=>'json', | |
'success'=>"function(data) | |
{ | |
if (data.status == 'failure') | |
{ | |
$('#dialogDamage div.divForForm').html(data.div); | |
$('#dialogDamage div.divForForm form').submit(doDamage); | |
} | |
else | |
{ | |
$('#dialogDamage').dialog('close'); | |
console.log(myvar.paper); | |
myvar.checked = 'true'; | |
myvar.attr({fill:myvar.paper.on_areacolor,opacity:0.8}); | |
} | |
} ", | |
// el.checked = 'false'; | |
// el.attr({fill:el.paper.off_areacolor,opacity:0.5}); | |
))?>; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment