This is a migrated thread and some comments may be shown as answers.

addRow() method throwing exception

2 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 07 May 2013, 03:21 AM
The addRow method is throwing "Object doesn't support this property or method" when running with IE  8.0.7601.17514

Run the attach solution.
Click Add Customer button.
In the popup enter 123456789 for Sage Customer Number and Test for Customer.
Click the X command at the top right of the popup dialog to cancel the addition.
Click Add Customer button and alert pops up indicating "Object doesn't support this property or method"

This code works properly in IE 9 & 10, Chrome(26.0.1410) and Firefox(20.0.1)

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 08 May 2013, 04:27 PM
Hi Robert,

 
After deeper investigation it seems that the issue is coming from the custom check inside the column template: 

<a class="k-button k-button-icontext k-grid-edit"><span class="k-icon k-edit"></span>Edit</a>
<a class="k-button k-button-icontext k-grid-delete"><span class="k-icon k-delete"></span>Delete</a>
//IE8 returns "uknown" as type of the ActivationCode property, which breaks the check below
# if ((typeof ActivationCode === 'undefined') || (ActivationCode == null)) { #
    <a class="k-button k-grid-invite">Invite</a>
# } else { #
    <a class="k-button k-grid-invite">Re-invite</a>
# } #

As described in the comment above IE8 returns another type "uknown" (more information is available on various resources over the internet) which passes the first check and when the code hits the second check it results in exception.

I would suggest to always render the both buttons and use the dataBound event to iterate over the current grid view and based on your custom logic to hide one of the buttons. This can be achieved using jQuery to find the corresponding row ("tr" element) for the current record using the "uid" property.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Robert
Top achievements
Rank 1
answered on 09 May 2013, 12:21 AM
Thank you Vladimir.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Robert
Top achievements
Rank 1
Share this question
or