You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

insertRow(undefined) TypeError: tab.insertRow is not a function

edited Feb 21, 2020 4:43AM in Visual Builder 2 comments

Content

Hi Experts,

I'm trying to build a page where I can give functionality to the user to add a row in a table by clicking on some button. For this, I have created a simple js function and calling on button event. Here is the snip of javascript code

PageModule.prototype.insertRow = function(event){
    var tab  = document.getElementById("oj-table--490912658-1");
    tab.insertRow(0)
    
  }

While clicking on the button, getting error as below

log.js:22 [VB (ERROR), /vb/action/action/CallModuleAction]: Action callModuleFunction1_ian8bf9vd: error running custom action: insertRow(undefined) TypeError: tab.insertRow is not a function
    at PageModule.insertRow (main-start-page.js:8)

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!