EasyUI Forum
September 16, 2025, 09:17:58 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Jquery EasyUI combogrid selected value  (Read 17570 times)
Jakob
Newbie
*
Posts: 8


View Profile
« on: April 04, 2013, 04:30:43 AM »

I have the following Combogrid for autocomplete drop down

Code:
$('#product').combogrid({  
    panelWidth:500, 
    url: 'myservice', 
    idField:'prodId', 
    textField:'desc', 
    mode:'remote', 
    fitColumns:true, 
    columns: [[ 
                {field:'prodId',title:'Product No',width:10}, 
                {field:'desc',title:'Desc',width:75}
            ]]
});
When user selects a value from drop down, I would like to set the description of the selected product to another input field.

How can I do this?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 04, 2013, 05:23:54 AM »

When select a row from drop-down panel, the 'onSelect' event is fired, in which you can get the selected row and assign the description field value to other input.
Code:
$('#product').combogrid({  
    panelWidth:500, 
    url: 'myservice', 
    idField:'prodId', 
    textField:'desc', 
    mode:'remote', 
    fitColumns:true, 
    columns: [[ 
                {field:'prodId',title:'Product No',width:10}, 
                {field:'desc',title:'Desc',width:75}
            ]],
onSelect: function(index,row){
var desc = row.desc;  // the product's description
console.log(desc);
}
});
Logged
Jakob
Newbie
*
Posts: 8


View Profile
« Reply #2 on: April 04, 2013, 10:24:43 AM »

Thanks, this has solved my problem.

I have another question, is is possible to bring results when minimum characters are typed, e.g. if 4 characters are typed then bring out the results rather than for each key stroke.

Regards
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!