1

I have a large and complex fancytree that uses ext-table in which the first column is the node title and the second is an <input> field. I am validating these input fields using jquery validate and I intend on getting the invalid elements through their .error class. After that I would like to be able to get the node that this element belongs to so I can alert the user exactly what node was invalid, or perhaps trace out a path of how to get to that node.

So my question is, given an input element is there a way I can get its fancytree node?

The best I can currently do is

$(".error").focus();
node = tree.getActiveNode();

But this requires my node to be visible, which it won't always be.

bpromas
  • 684
  • 1
  • 11
  • 25

1 Answers1

2

You could try this (untested):

errElements = $(".error");
firstNode = $.ui.fancytree.getNode(errElements[0]);
mar10
  • 14,320
  • 5
  • 39
  • 64