EasyUI Forum
December 06, 2025, 06:19:33 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: Nested Subgrids - Using External data  (Read 9925 times)
stephenl
Newbie
*
Posts: 40


View Profile
« on: March 27, 2016, 08:14:54 AM »

Hello

I am trying to build an Nested Grid ui based upon the example here
http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=

I have succesfully modified the code to use external data for the main grid, however I am having problems getting external data for the subgrids....in my application this data would be based upon 2 of the fields from the main grid, say company and contact..

I have tried addining a url: however this would also need 2 parameters company and contact, based upon the selection from the main grid

I think the "foreignField:" may have something to do with this, but carn't seem to find an explanation of its use

Any suggestions would be appreciated

Thank you


Logged
jarry
Administrator
Hero Member
*****
Posts: 2303


View Profile Email
« Reply #1 on: March 28, 2016, 12:28:46 AM »

The 'foreignField' property value can be a string or a function. When set as a function, it must return the object that will be set as the query parameter values. Be sure to download the newest 'datagrid-detailview.js' file from http://www.jeasyui.com/extension/datagridview.php.
Code:
//foreignField:'companyid',
foreignField:function(prow){
    return {
        contact:prow.contact,
        company:prow.company
    }
},
Logged
stephenl
Newbie
*
Posts: 40


View Profile
« Reply #2 on: March 28, 2016, 12:27:54 PM »

How did I miss that explanation....!- Thank you !
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!