"Edit Mode" button

Andrey, that likely means your selector for the variable “fieldeditor” didn’t return any elements. The line below is what you’ll want to check.

var fieldeditor = $('.nx-basicfieldeditor:visible').data('object');

A quick way to check would be to open up the js console in Chrome (right click somewhere on the page → inspect element → click console) and print the number of items that fit the selector to the log by checking the length:

console.log($('.nx-basicfieldeditor:visible').length);

If it returns 0, you need to make sure you have any field editors on the page that meet the selector’s criteria (in this case, that they’re visible). If that doesn’t help, let me know. We can dig deeper.