首先,我声明了一个名为 leventcombo 的 Ext.form.ComboBox,并且我还创建了一个名为 leventstore 的商店 Ext.data.JsonStore。我可以访问 php 文件并且数据可以返回 javascript。但我无法将 id 值传递给 php 文件。我怎样才能发送它?
var leventcombo = new Ext.form.ComboBox({
store: leventstore,// call jsonstore
fieldLabel: '',
minChars: 2,
width:50,
displayField:'isim',
valueField: 'isim',
typeAhead: false,
loadingText: dil('Aranıyor...'),
hideTrigger:true,
tpl: template1,
emptyText: dil('levo ...'),
itemSelector: 'div.search-item',
name: 'leventwindeneme',
id: 'leventwindenemeID',
anchor: '100%',
allowBlank:false,
listeners:{
beforequery: function(){
}
}
});
var leventstore = new Ext.data.JsonStore({
totalProperty: 'results',
root: 'rows',
id: 'id',
proxy: new Ext.data.HttpProxy({
url: 'phps/leventstore.php?lang=dil(lang)'
}),
fields: [
{
///phpden dönen veriler
name:'id'
},{
///phpden dönen veriler
name:'isim'
}]
});
leventstore.php:
<?php
include_once("kutuphane/inc.php");
$sql="select id, isim from levent";
$_SESSION["VT"]->doQuery($sql);
$donecek = $_SESSION["VT"]->arrayYapVer();
$veriler=array();
if (sizeof($donecek) > 0) {
foreach ($donecek as $file) {
$tempFi = array();
$tempFi = array(
"id" => $file["id"],
"isim" => $file["isim"]
);
array_push($veriler, $tempFi);
}
}
$donecek = array("results" => (sizeof($donecek)), "success" => "true", "rows" => $veriler);
echo json_encode($donecek);
?>