I have a master grid of cars where you select one and the price plus mileage is communicated to the detail grid as subgridparams. As you know from my code, this works very well. However, in the detail grid, I want for each row to take the price and mileage of the competitive car and subtract from these the price and mileages from the master grid to provide the difference. For example, I select a car costing £10,000 in the top grid and in the detail grid the first row has a car costing £8,000 so I want to show £2,000 in the Price Diff column and so on for each row.
I created a function and event for the do_onload of the detail grid. I know how to get the values of the subgridparams. I can for each row in the detail grid get the price and mileage of each car. How do I set the value of the Price Diff and Mileage Diff columns? Do they have to be editable=true? For example, I tried:
jQuery(‘[name=”car_mileage_diff”].editable’).val(mileage – comp_mileage);
I figured out the following code:
st = (mileage – comp_mileage).toString();
but how do I use the column name rather than the column number?
Just to log the solution, better way to pick column is to use aria-describedby attribute.
Instead of td:eq(11)
You can use:
where list1 is grid id and colname is column name.
Abu Ghufran - Dev Team
Grid 4 PHP Framework
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?