EasyUI Forum
May 08, 2024, 04:48:05 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: Set value in combox from datagrid  (Read 8803 times)
dtucker
Newbie
*
Posts: 11


View Profile Email
« on: December 27, 2013, 09:16:10 AM »

I have a grid and when they select a row it brings up a dialog box with a textbox and a combobox. The data is being sent to the dialog box but the dropdown is not selecting the correct value.

Here's my code:

When they select a row I call a method:
Code:
var row = $('#dgCategory').datagrid('getSelected');
        if (row){
            $('#dlgCategory').dialog('open').dialog('setTitle','Edit Category');
            $('#frmCategory').form('load',row);
            url = 'Category/UpdateCategory.php?orgid='+_selectedOrganization + '&categoryid=' +row.categoryid;
        }

Here's the html code for the dialog box:
Quote
<div id="dlgCategory" class="easyui-dialog"
                        style="width: 300px; height: 180px; padding: 10px 20px"
                        closed="true" buttons="#dlgCategory-buttons">
                        <form id="frmCategory" method="post">
                           <div class="fitem">
                              <input  name="categoryid">
                           </div>
                           <div class="fitem">
                              <input  name="category">
                           </div>
                           <div class="fitem">
                              <label>Category:</label> <input id="cboCategory"
                                 class="easyui-combobox" name="cboCategory"
                                 data-options="valueField:'id',textField:'text',url:'Lookups/Lookup.php?id=56660623-9932-42AD-AF88-8554618B4997', required:'true', panelHeight:'auto'">
                           </div>
                        </form>
                     </div>

Thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 27, 2013, 06:26:00 PM »

The data returned from your 'Lookup.php' must be:
[{"id":1,"text":"text1"},{"id":2,"text":"text2"}]

Please confirm if the returned data is correct.
Logged
dtucker
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: December 29, 2013, 08:23:49 AM »

The data being return is xml. The dropdown is populating just not selecting the value when I click a row in the grid to edit it.
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!