Hi support,
I have a working grid and childgrid view which sends the request to get the childgrid data including the defined 'queryString' parameter.
How can I add a second parameter to this childgrid request?
Some more details:
At the moment I show this in the Grid:
Destination IP | Destination name | Source IP |
123.123.123.123 | Test 1 | 122.122.122.122 |
123.123.123.123 | Test 1 | 13.13.13.13 |
123.123.123.123 | Test 1 | 11.11.11.11 |
234.234.234.234 | Test 2 | 122.122.122.122 |
If I now open the childgrid for the first row I do not only see the first row (and more data fitting that row), but I also see more data stemming from row 2 and 3 as the queryString 'Destination IP' is the same for all of those 3 rows. That's why I need to include the 'Source IP' when expanding the childgrid - and I could not find a way to do this.
I have attached the file I am currently working with and would appreciate any help.
Thank you !
Daniel
// Grid’s detailDataBound event handler
function onDetailDataBound(args) {
args.childGrid.query = new ej.data.Query().addParams('CustomData', args.data.FirstName);
args.childGrid.refresh();
} |
Hi Sujith,
apologies for the late reply.
Your solution works - thank you for that.
I have seen that your approach triggers 2 queries - one with the original queryString, and then one with the second parameter. Is there a way to only send one request including both parameters to the external API ?
// ChildGrid’s load event handler
function load() {
this.query= new ej.data.Query().addParams('CustomData', this.parentDetails.parentRowData.FirstName); } |
Hi Praveenkumar,
works like a charm - thank you very much !
Have a great day,
Daniel
The only way to do this is to create a new function that you can call from within the function that has the existing parameter.
One way of doing this is by adding a second parameter. Let's take a look at what it would look like:
function myFunction(val) {
// function body goes here
}
// add the second parameter:
myFunction('2');
Do you want more solutions on javascript?
Learn javascript Tutorial Online