Nesting Datatable implementation Issue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hello Guys,
I am trying to add couple of nesting DataTable like
Table1
  > Table2
    > Table3

Everything working fine till Table2 but if I try to expand for Table2 error occurs in console "Cannot read property 'Id' of undefined"

I have dig much into it and did noticed that same "td.child-control" click event is raised for Table1 and Table2. It should different event for both tables. What I mean here is, while expanding Table1 funtion(Table1 tbody).on('click', 'td.child-control') is invoked which work fines. For Table2 it should be invoking funtion(Table2 tbody).on('click', 'td.child-control') but it invokes Table1 function.  

I haven't done any custom changes just using same "Table.cshtml" which resides in Admin/Views/Shared/

Is there any alternate way around? Or any help will be appreciated.

Thanks
2 years ago
What version of nop? I remember seeing a few threads on nested/multiple child tables that may be worth searching for, and here is a possibly relevant commit for 4.2:
https://github.com/nopSolutions/nopCommerce/issues/4234
2 years ago
motoTed wrote:
What version of nop? I remember seeing a few threads on nested/multiple child tables that may be worth searching for, and here is a possibly relevant commit for 4.2:
https://github.com/nopSolutions/nopCommerce/issues/4234


I am currently working in 4.40 version. I have checked the above URL which you shared. 4.40 does have the same code BTW. I have traced the code and did discovered that current model function is not invoked and parent model function do get invoked. Why that so? Cause explicitly new generated DataTable resides within TBody of Parent.
So for example let assume Function $('#Customer-Grid tbody').on('click', 'td.child-control', function () {} is generated for Parent table.

All newly added DataTables resides in TBody of Parent DataTable and does have class 'td.child-control', so It calls Parent table function cause it meets the function requirements.
2 years ago
We are investigating this. Here's a work item.
2 years ago
DmitriyKulagin wrote:
We are investigating this. Here's a work item.


Thanks Dmitriy... :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.