Datatables as editor field
Datatables as editor field
This is probably pretty trivial, but I can't seem to figure this out.
I have a list of parts being displayed in a datatable. Each of those parts can have sub-parts associated with each of them. When the user selects one of the parts I would like the editor to list, in a datatable, the sub-parts associated with that part that they selected. Once the editor is open, they can add/edit/delete from that list of sub-parts.
Do I need to fill the datatable of sub-parts on the editor preOpen event?
Looking for the best solution.
This question has an accepted answers - jump to answer
Answers
Do you mean like this?
Allan
Yes, kind of like that. I'll look at that example a little more.
I looked at the example some more and understand how it's working.
Is there a way to pass data to the ajax request for the datatable field in the editor? I only want to display specific items from a table. Not all items the example.
If I have a part number: 1234 and items 1, 5, 10 are associated with it, I only want to display those items in the editor datatable. Not items 1 - 10.
From nested.html:
You can access the main table still in that
ajax.data
function - so something like:which you can then pull out the field you're interested in and include like you are. Hope that helps,
Colin
I'm getting: Uncaught TypeError: Cannot read property 'DT_RowId' of undefined
when I try using the ajax.data function.
We would need to see that. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I get the same error message if I add the ajax.data function to the example nested.html file.