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

Please resolve the IE issue. I am facing problem in IE9 with the below code when i am adding new row in grid

3 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rama
Top achievements
Rank 1
Rama asked on 14 Dec 2012, 03:14 AM

IN kendo.core.js v2012.1.322
File :
// Internet Explorer does not support setting the innerHTML of TBODY and TABLE elements
        try {
            table.innerHTML = "<tr><td></td></tr>";

            /**
             * Indicates whether the browser supports setting of the &lt;tbody&gt; innerHtml.
             * @name kendo.support.tbodyInnerHtml
             * @property {Boolean}
             */
            support.tbodyInnerHtml = true;
        } catch (e) {
            support.tbodyInnerHtml = false;
        }


IN kendo.web.js2012.1.322
File
var tbodySupportsInnerHtml = kendo.support.tbodyInnerHtml,
if (tbodySupportsInnerHtml) {
                that.tbody[0].innerHTML = html;
            } else {
                placeholder = document.createElement("div");
                placeholder.innerHTML = "<table><tbody>" + html + "</tbody></table>";
                tbody = placeholder.firstChild.firstChild;
                that.table[0].replaceChild(tbody, that.tbody[0]);
                that.tbody = $(tbody);
            }

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 17 Dec 2012, 08:06 AM
Hello Rama,

 I am not sure what the problem is and how the code you have pasted is related to it. Grid editing works as expected in IE9. Check our online demos.

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Rama
Top achievements
Rank 1
answered on 17 Dec 2012, 11:24 AM
Hi Atanas, Thank you for your quick reply. Please look into below code segment, i added comments.

           if (tbodySupportsInnerHtml) {
             //This block of code is executed for Mozilla, chrome....etc
                that.tbody[0].innerHTML = html;

            } else {
           
             //This block of code is executed for Internet Expolorer , because Internet Explorer does not support setting the innerHTML of TBODY //   and TABLE elements.

                placeholder = document.createElement("div");

                placeholder.innerHTML = "<table><tbody>" + html + "</tbody></table>";

                tbody = placeholder.firstChild.firstChild;
                
// When there is no record in the grid, if we try to push record into the grid we are getting the following exception in IE9,
                            
//      Error: DOM Exception: NOT_FOUND_ERR (8)
                
//     Line: that.table[0].replaceChild(tbody, that.tbody[0]);
                
// This behaviour is we are trying to replace the tbody[0] which is not there in table (here tbody[0] is undefied at this time)
//       So, to resolve the issue i am first pushing the record, then replacing the record into the grid.
                
                try{
               
                that.table[0].replaceChild(tbody, that.tbody[0]);
               
                }catch(e){
               
                that.table[0].appendChild(tbody);

                }


// Please advise me, if there is any other resolution for this problem.
0
Atanas Korchev
Telerik team
answered on 17 Dec 2012, 04:37 PM
Hi,

 We can't reproduce the problem. Here is a live demo showing what we tested: http://jsbin.com/ehumaf/1/edit

 Please modify our example to show us what your code is.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Rama
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Rama
Top achievements
Rank 1
Share this question
or