Parent / child editing with RowId on parent
Parent / child editing with RowId on parent
INR
Posts: 20Questions: 2Answers: 1
I am following this article ( https://datatables.net/blog/2019-01-11 ) and it works.
But when RowId is specified for the parent table, the child will not be displayed. I am using RowId to enable the Line Edit option
Can you please provide a suggestion ?
This discussion has been closed.
Answers
I'm afraid I don't quite understand what you are looking for.
Is that a customisation over what the blog post does? Or are you getting to a specific step in the blog which is failing for you?
Can you link to a page showing the issue you are seeing please?
Thanks,
Allan
Hi Allan,,
yes, I am trying to extend the functionality (in-line editing) of what is explained on the post.
i am not using the C# Server-side editor components and passing the modified row (all columns) to C# via AJAX. I have to specify the RowId, to make it work.
the below is the code (slightly different to https://datatables.net/blog/2019-01-11) the which i am working with. When RowId is commented, when clicking the expand image, the child will get open and it works. When RowId is uncommented, the child will open and automatically gets closed. I tested with same code as https://datatables.net/blog/2019-01-11 and the behavior is same.
Hi Allan,
the post works if we use as it is. When I add rowId to the parent table, it will the child table automatically gets closed when its opened.
Looks like rowId is causing some issues and the child table gets automatically closed when it opens. If I comment the rowId, it works like how it explained on the post.
hope this helps.
It's not immediately obvious to me why
rowId: 'HeaderId'
would make any difference there. Can you give me a link to your page so I can trace it through please?Thanks,
Allan
Hi Allan,
HeaderId is the uniqueKey on the dataset. I am trying to use the in-line editing.
you add any column as like rowId: 'xxx' and the Child dataTable will close automatically when its opened/expanded.
Probably I will prepare a working script and provide.
Hi Allan,
I think I found the combination of attributes which are causing this issue. The problem occurs when we specify "responsive: true" and "rowId: 'HeaderId' on the parent data table.
but I couldn't re-produce with jsfiddle ( https://jsfiddle.net/INR_R/1pnz2wvk/45/ )
Is it possible for you to gran the code from my jsfiddle and test in your environment with these 2 parameters enabled?
Regards
we have to use AJAX data source to get the issue. thats why in jsfiddle i couldnt get the issue.
I use ajax call to the C# method.
Right - I think at least part of the issue is that you have a conflict between the Responsive control and your child row control. By default (
responsive: true
which is what you have) Responsive will show a child row when clicking on the first column in the table (if the table is collapsed). But you also have your event handler for the child row editing on the first column.What I would suggest is that you separate the two. Make the Responsive control in its own column and likewise the child row.
Additionally, because you can't mix Responsive's child rows with your own child rows, you should use a modal to display the hidden details from the row. Otherwise, again, you'd have a conflict.
Allan
Thanks Allan. I will try the "responsive control its own column"
I couldnt understand why it fails when using AJAX and working fine when we pass the JSON array as data set ?