Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent input select parser from handling events from child rows #1399

Merged
merged 1 commit into from
May 12, 2017

Conversation

andysleigh
Copy link
Contributor

Currently the input select parser is handling events from all rows within a table. It should not be handling events from child rows. When it does the call to updateCell fails as this does not expect to be called on child row cell. The fix is to return from the event handlers immediately if the row is a child row.

@Mottie Mottie merged commit a23e12a into Mottie:master May 12, 2017
@Mottie
Copy link
Owner

Mottie commented May 12, 2017

Thanks! I appreciate it!

@Mottie
Copy link
Owner

Mottie commented May 12, 2017

Hey @andysleigh!

I ended up adding an option (ignoreChildRow) to enable or disable child row events and set it to false by default to maintain current behavior. Then I noticed using updateCell on child rows was causing a javascript error. Ugh. So, I've disabled triggering "updateCell" on child rows for now (in the core plugin) and I will work on an update this weekend.

@andysleigh
Copy link
Contributor Author

Hi @Mottie,

The error in updateCell is why I originally went about making this change. But from my understanding, we would never need to call updateCell for a child row cell, as these are not held in the internal cache, which is why I just disabled it altogether. Please let me know if I've missed something.

@Mottie
Copy link
Owner

Mottie commented May 12, 2017

The child rows are held in the cache along with the parent row. If you look at the cache for a parent row, you'll see this:

[
  "parent row 1 col 1",
  "parent row 1 col 2",
  {
    // jQuery object
    $row: [
      $parentRow,
      $childRow1,
      $childRow2
    ],
    // child row text (parsed)
    child: [
      [
        "child row 1 col 1",
        "child row 1 col 2"
      ],
      [
        "child row 2 col 1",
        "child row 2 col 2"
      ]
    ],
    // original parent row index (used when sort is reset)
    order: 0,
    // unparsed raw text content from the parent row
    raw: [
      "parent row 1 col 1",
      "parent row 1 col 2"
    ]
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants