How do you make drawCallback: function() target only the parent of a multi-level form?

How do you make drawCallback: function() target only the parent of a multi-level form?

koniahinkoniahin Posts: 186Questions: 39Answers: 7

Reference: https://datatables.net/blog/2016-03-25

For our business/contacts form we modeled it after that blog posts. See our Businesses / Contacts 2 form for this post.

In the parent table area of the form I added:

drawCallback: function() { cms.footerSelectFilter(this.api(), [7,8,9,10]); },

This should only be applied to the parent table. We don't want to apply the filters to the child table; also the columns would get mixed up if we did. The issue here is that adding that line in the parent area is causing the select-list filter to display with both parent and child.

How do we make it work so that it only applies to the parent table?

If you need access to see the page, please create an account on www.smokeymo.xyz. Ignore the email but inform me and I will update your access level. Tx.

Answers

  • kthorngrenkthorngren Posts: 21,324Questions: 26Answers: 4,949

    What does the function cms.footerSelectFilter() do? My guess is it uses draw() to execute a search plugin. If yes then in the search plugin you can verify which table the plugin executes against. See this thread for an example.

    Kevin

Sign In or Register to comment.