Hallo Community,
At first i will say my englich is not so good, i hope you excuse me.
I have an existing Codeigniter, Ajax and EasyUI Projekt and then i must adjust it. Im new in this topic and don't found a post to my problem into the internet. Then i hope you can help me.
To my problem.
I will post a PHP-View with HTML-Code and EasyUI-Code into a Div in my Main-Page. But the EasyUI Datagrid dosn't show and the javascript methode $(document).ready(function()) dosn't call too. When i show the PHP-View it show me the Datagrid-Component.
My Code:
The Div in my Main-Page
<div title="Karten" style="overflow:auto;padding:10px;">
<div id="kartenan"></div>
</div>
The Javascript-Code to post the PHP-View into the div
// load Karten-Datagrid
$.post(
'<?php echo base_url(); ?>index.php/ajax/datagrid_kartenliste/' + id,false,
function success(html){
$('#kartenan').html(html);
}
);
The Ajax-Method datagrid_kartenliste
public function datagrid_kartenliste($id) {
$this->load->view('kartenliste',array(
"base_url" => base_url(),
));
}
The PHP-View 'kartenliste.php'
<html>
<head>
<title>Kartenliste</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="<?php echo $base_url; ?>application/views/easyui/themes/default/easyui.css">
<script type="text/javascript" src="<?php echo $base_url; ?>application/views/easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>application/views/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>application/views/easyui/datagrid-detailview.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>application/views/easyui/jquery.edatagrid.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>application/views/easyui/datagrid-groupview.js"></script>
</head>
<body>
<div region="center" style="height:200px; width:265px;">
<div region="center" style="height:180px; width:265px;">
<table id="dgkart" class="easyui-datagrid"
data-options="
singleSelect: true,
fitColumns:true,
url: '<?php echo base_url(); ?>index.php/ajax/datagrid_left',
onClickRow: enable_button_karte
">
<thead>
<tr>
<th field="idanzeige" width="35px">ID</th>
<th field="nr" width="98px">Nr</th>
<th field="pin" align="center" width="37px">PIN</th>
<th field="puk" align="right" width="90px">PUK</th>
</tr>
</thead>
</table>
</div>
<a id="btka" class="easyui-linkbutton">Neu</a>
<a id="btkb" class="easyui-linkbutton">Bearbeiten</a>
</div>
</body>
<script type="text/javascript">
var editIndex = undefined;
var detailID = undefined;
$(document).ready(function() {
alert("Test")
});
</script>
</html>
The easy-linkbutton are show, but not the datagrid and not the alert into the $(document).ready(function())
I hope you can help me.