This question is locked. New answers and comments are not allowed.
I recently upgrade to the latest Telerik release and am getting a script error now on some custom commands that I have in the command toolbar. I have traced through the error and figured out the cause, but wanted to find out if I am doing something wrong or if this is expected behavior.
The grid is an ajax-bound editable grid using a pop up edit form. I'm not sure if that makes a difference or not. What's happening is when I click on one of the buttons I get a 'closest(...).validate()' is null or not an object' script error in this code in the telerik.grid.editing.js file:
This seems to be caused by the update row logic being fired off from the command button. The command button is being automatically decorated with the t-grid-update class, which then causes the updateRow event to be hooked up due to this code:
Should command buttons have the t-grid-update class? Since they are outside of the actual grid, I don't understand how they could call updateRow properly. Or am I doing something wrong in my setup? I do have a call to preventDefault() in my code that runs in the onClick button event, but it seems like this save is taking place before my code event gets called.
Thanks for your help. Please let me know if there's any more information I can provide.
Regards,
Brian
The grid is an ajax-bound editable grid using a pop up edit form. I'm not sure if that makes a difference or not. What's happening is when I click on one of the buttons I get a 'closest(...).validate()' is null or not an object' script error in this code in the telerik.grid.editing.js file:
save:
function
(element, callback) {
$(element).closest(
'form'
).validate().form() && callback();
},
This seems to be caused by the update row logic being fired off from the command button. The command button is being automatically decorated with the t-grid-update class, which then causes the updateRow event to be hooked up due to this code:
.delegate(
'.t-grid-update'
,
'click'
, $t.stopAll(
function
(e) {
grid.save(
this
, $.proxy(
function
() {
grid.updateRow($(
this
).closest(
'form'
).closest(
'tr'
));
},
this
));
}))
Should command buttons have the t-grid-update class? Since they are outside of the actual grid, I don't understand how they could call updateRow properly. Or am I doing something wrong in my setup? I do have a call to preventDefault() in my code that runs in the onClick button event, but it seems like this save is taking place before my code event gets called.
Thanks for your help. Please let me know if there's any more information I can provide.
Regards,
Brian