|
thiago_brum
|
 |
« on: April 18, 2016, 12:34:51 PM » |
|
I have a combobox:
<input id='f1-cod_nat_oper' name='cod_nat_oper' class='easyui-combobox' style='width:300px;' value='' data-options="valueField: 'cod_nat_oper', textField: 'den_nat_oper', url: 'buscar_tabela.php', mode: 'remote', queryParams: {nom_tabela:'nat_operacao', campo_cod:'cod_nat_oper', campo_txt:'den_nat_oper' },required:true">
With my PHP load data:
<?php
$q = $_REQUEST['q']; $nom_tabela = $_REQUEST['nom_tabela']; $campo_cod = $_REQUEST['campo_cod']; $campo_txt = $_REQUEST['campo_txt'];
$result = array();
$query = "SELECT $campo_cod, $campo_txt FROM $nom_tabela WHERE (UPPER($campo_txt) LIKE UPPER('$q%') OR TO_CHAR($campo_cod) = '$q') ORDER BY $campo_txt "; $exeTabela = odbc_exec($conecIfx,$query) or die("Error: ".odbc_error()."<br>Query: ".$query); while($rowTabela = odbc_fetch_array($exeTabela)){ $rowTabela[$campo_txt] = trim($rowTabela[$campo_cod])." - ".trim($rowTabela[$campo_txt]); array_push($result, $rowTabela); }
echo json_encode($result);
?>
If I type a value exactly equal to valueField and select it in the dropbox, it shows the valueField in the combobox, not the textField. How can I fix this?
Ex: - I type "Venda". I select "1 - Venda Produto" in the dropbox. Combobox text shows "1 - Venda Produto". - I type "1". I select "1 - Venda Produto" in the dropbox. Combobox text shows "1".
|