I have a scenario with grid within grid implemented using the detailInit method. Here when user makes edit, i do some calculations that will change the data in the both parent and child. and then to refresh data, i will call the datasource.read to render data. this works and the data is displayed, however any detail grid which are expanded will be collapsed, is there any way i can prevent this from happening.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
Different but similar solution that i used for same problem:
Actually all that is needed is the 'subgridChange()' function in the main grid 'dataBound' function:
When a user selects a row, record the index of the selected row. Then after your data refresh, use the following code to expand a row
To expand different rows, just change the number in the
nth-child()
selector to the index of the row you wish to expand.To answer this and another question:
"I figured out how to set the data in the master from the child BUT, the whole table collapses the child grids when anything is updated, this is a very annoying behavior, is there anyway I can just update a field in the master table without it collapsing all the child elements? (basically, update the column, no mass table update)"
in another thread at: telerik
This is extremely annoying behavior of the Kendo Grid and a major bug. Since when does a person want the sub-grid to disappear and hide a change that was just made! But this isn't the only problem; the change function gets called a Fibonacci number of times, which will freeze the browser after a significant number of clicks. That being said, here is the solution that I have come up with:
In the main grid
Unfortunately globally we have:
Now the 'subgridChange()' function needs to be called every time a change is made to the subgrid.
The problem is that the number of times the change function in the subgrid gets called increases exponentially on each change call. The Kendo grid should be able to call a stop propagation function to prevent this, or at least give the programmer access to the event object so that the programmer can prevent the propagation. After being completely annoyed, all we have to do is to place the 'subgridChange()' function in the subgrid 'datasource' like so:
I also had to place the 'subgridChange()' function in the Add button function using something like this