Closed purplepiranha closed 3 years ago
There also seem to be other issues with child tables. For example the Inline Edit doesn't seem to display the input box when the EditType is EditType.String. Also the parent table refreshes when a delete is performed, rather than just the child table.
@purplepiranha We have made some changes to improve this functionality, you can find them in the develop branch. Please, check this commit -https://github.com/nopSolutions/nopCommerce/commit/4de48951e224c1c203568d5f77dca86c016d2707
Thanks @DmitriyKulagin. Unfortunately it doesn't appear to address those specific issues.
@purplepiranha Then describe the problems in more detail so that we can investigate them. Alternatively, you can submit a pull request if you already have a solution.
@DmitriyKulagin - the fix for the footer (as detailed above) is currently in an Azure repo, but when I get a chance I'll add it to a fork here and submit a pull request.
The other problems (with child tables) are to do with inline editing/deleting:
@purplepiranha I have not been able to reproduce the issue of editing inline values with the type EditType.String. Judging by the screenshot, your solution is customized and we are trying to reproduce the problem on different settings.
And as for updating the child table after deletion. There can be different usage scenarios, and the most common approach would be to update the parent table after modifying the child.
nopCommerce version: 4.30
Steps to reproduce the problem: Add 'FooterCallback' to a ChildTable within the admin section
The footer is never rendered as the child table does not have a 'tfoot' section. As stated in Table.cshtml you need to add the footer before the table is created as DataTables doesn't provide a method for creating a footer.
Workaround: In Table.cshtml after
insert
and then change
return childTable = '<table id="child' + d.@(curModel.PrimaryKeyColumn) + '" class="table table-bordered table-hover dataTable" width="100%" style="padding-left:2%;"></table>';
toreturn childTable = '<table id="child' + d.@(curModel.PrimaryKeyColumn) + '" class="table table-bordered table-hover dataTable" width="100%" style="padding-left:2%;">@(Html.Raw(footerHtml))</table>';