Created
January 4, 2015 18:19
-
-
Save jimgwhit/bf895cab9d7f98d6ab45 to your computer and use it in GitHub Desktop.
see this
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
/////////controller | |
public function getowner() { | |
$id = $_GET['id']; | |
$data = $this->Powners->get($id); | |
$petowner = $data->oname; | |
$ostreet = $data->ostreet; | |
$retvalue = $petowner . "|" . $ostreet; | |
echo $retvalue; | |
exit; | |
} | |
///////////Jquery | |
$("#myTable td:nth-child(1)").click(function(event) | |
{ | |
event.preventDefault(); | |
var $td= $(this).closest('tr').children('td'); | |
var currentCellText = $td.eq(0).text(); | |
var CellText = $td.eq(1).text(); | |
$.ajax({ | |
url:'<?php echo "getowner";?>', | |
type: 'GET', | |
data: 'id='+currentCellText, | |
success: function(data) { | |
//window.opener.$('input#petowner').val(data.petowner); | |
alert(data); | |
var mystr = data.split("|"); | |
window.opener.$('#petowner').val(mystr[0]); | |
window.opener.$('#ostreet').val(mystr[1]); | |
self.close(); | |
} | |
}); | |
});// JavaScript Document | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment