i want add combobox-easyui dynamically into my page, when i refresh will read my database and show combobox-easyui
<html>
<script>
$(document).ready(function(){
$.ajax({
async: false,
type: "POST",
url:"testFunc.php",
data: "proses=1",
dataType: "json",
success: function(data) {
document.getElementById('mybody').innerHTML =data[0].model;
},
error : function() {
},
complete: function() {
}
});
});
</script>
<body>
<div id="mybody">
</div>
</body>
</html>
testFunc.php
if (isset($_POST)){
$qstring = "select * from coba";
$rs = mysqli_query($conn_login,$qstring);
$items = array();
while($row = mysqli_fetch_object($rs)){
array_push($items, $row);
}
echo json_encode($items);
}
table coba just 1 record and 1 field with name "model" as text type
model field contain :
<input name="dataku" class="easyui-combobox" data-options="
valueField: 'label',
textField: 'value',
data: [{
label: 'java',
value: 'Java'
},{
label: 'perl',
value: 'Perl'
},{
label: 'ruby',
value: 'Ruby'
}]" />
the problem my page just show textbox standar html not combobox-easyui, plase help me how to fix this
Thanks