Problem with multiple instances of AutoFill plugin on the same page

Problem with multiple instances of AutoFill plugin on the same page

GnexGnex Posts: 3Questions: 0Answers: 0
edited November 2013 in Plug-ins
I am using DataTables Plugin to render a parent/child table relationship. When you expand the parent row an inner DataTables enhanced table gets rendered. The parent table has 14 columns while the child table has 43. I'm using the AutoFill extra plugin to add Excel like drop fill to both tables.

The problem occurs when I hover over the child table on any column index of over 14 (the max columns on the parent table). In the AutoFill plugin the _fnFillerDisplay function gets called on a hover of any td in the tbody. The issue is when that function gets called, "this" is representing the parent Autofill object, not the child. So when an column index of great than 14 is being checked in the this.s.columns[iX].enable call it throws an error because to the parent there is not column greater than 14.

My question is can the AutoFill plugin handle multiple different instances of itself. Thanks.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    So the child table is inside the parent table is it? I suspect that's the problem - if the tables were separate then it would work okay, but one inside the other will cause the events to propagate up. AutoFill wasn't really designed with that flow in mind, but its a good point and I'll add it to the feature list.

    Regards,
    Allan
  • GnexGnex Posts: 3Questions: 0Answers: 0
    Allan;
    Yes the child table is inside the parent table. Can you suggest a way to address that issue? That feature is an important feature for our functionality. Any clues would be greatly appreciated.

    Guario
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sorry - as I say, AutoFill wasn't designed to work that way. I'm sure it could be done, but I'm up to my eyeballs at the moment, and it will likely take a little bit of hacking in AutoFull to make it work. I'm not sure immediately how it would be done other than that you would need to check on each cell if it is part of the DataTable hosted rows (and therefore use the fnUpdate API) or if it is a child row and therefore use jQuery / DOM methods.

    Allan
  • GnexGnex Posts: 3Questions: 0Answers: 0
    Thanks Allan. I will look into that
This discussion has been closed.