jQuery UI Widgets › Forums › Grid › Master detail pass more than 1 variable to detail grid
Tagged: grid, master-detail
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 2 months ago.
-
Author
-
Is there a way to pass more than 1 variable to the detail grid? In your php demo examples, it passes CustomerID. I would like to pass var1, var2 to the sql query.
Great product!!
Anyone find the answer to this?
Hi pdave,
To pass custom variables to a server, you can use the formatData callback function of the source object. Please, look at: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thank you Peter for replying. In that example, the following code passes hard coded values:
data: {
featureClass: “P”,
style: “full”,
maxRows: 50
}How do I pass the values of the selected row? Also in your master detail grid example, how do I have more than 1 ID in:
// prepare the data
var source =
{
datatype: “json”,
datafields: [
{ name: ‘CustomerID’, type: ‘string’},
{ name: ‘CompanyName’, type: ‘string’},
{ name: ‘ContactName’, type: ‘string’},
{ name: ‘ContactTitle’, type: ‘string’},
{ name: ‘Address’, type: ‘string’},
{ name: ‘City’, type: ‘string’}
],
id: ‘CustomerID’,
url: ‘data.php’,
cache: false,
root: ‘Rows’,
beforeprocessing: function (data) {
source.totalrecords = data[0].TotalRows;
}
};Hi pdave,
May be you missed the formatData callback which I pointed out in my previous post. It is used for Dynamic passing of variables.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.