EasyUI Forum
December 05, 2025, 04:02:31 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combobox Select Error  (Read 14233 times)
thiago_brum
Newbie
*
Posts: 26


View Profile Email
« 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".
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 18, 2016, 07:34:23 PM »

Please try to download the patch file from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.5-patch.zip.
Logged
thiago_brum
Newbie
*
Posts: 26


View Profile Email
« Reply #2 on: April 19, 2016, 07:22:35 AM »

Thanks for help. I tried the patch but now I can't select item in the dropbox.
« Last Edit: April 19, 2016, 07:24:10 AM by thiago_brum » Logged
thiago_brum
Newbie
*
Posts: 26


View Profile Email
« Reply #3 on: April 27, 2016, 07:08:40 AM »

someone help?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: April 27, 2016, 06:26:42 PM »

Please look at this example http://code.reloado.com/avoxej4/edit#javascript,html. It works fine.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!