Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
AfterRowActivate javascript error
posted

ok, i have the javascript for the AfterRowActivate event.  I am getting an error on my page

Error: Object doesn't support this property or method

Code: 0

 

here is the script

 

function EnableDisableButtons() {             var grid = document.igtbl_getGridByID("ctl00_ContentPlaceHolder1_uwg_Schedule")                   var type = grid.Rows[grid.ActiveRow.Index].Cells[15].Text                   if (type != 'APPT') {                     document.getElementById('ctl00_ContentPlaceHolder1_ddlResults').disabled = true;                     document.getElementById('ctl00_ContentPlaceHolder1_btnSaveResult').disabled = true;                     document.getElementById('ctl00_ContentPlaceHolder1_btnContact').disabled = true;                     }                 else if (type = 'APPT') {                     document.getElementById('ctl00_ContentPlaceHolder1_ddlResults').disabled = false;                     document.getElementById('ctl00_ContentPlaceHolder1_btnSaveResult').disabled = false;                     document.getElementById('ctl00_ContentPlaceHolder1_btnContact').disabled = false;                     }

 

 

any ideas? I htink it is something simple, but i don't see it.

  • 280
    Verified Answer
    posted

    the answer was i wasn't passing anything into the js as required, i will paste everything back in...

    function EnableDisableButtons() should have been

    function EnableDisableButtons(tablename, itemname)

     var grid = igtbl_getGridById(tablename);
                    var row = igtbl_getRowById(itemname);
                    var cell = row.getCell(15).getValue();

                    if (cell != 'APPT') {
                        document.getElementById('ctl00_ContentPlaceHolder1_ddlResults').disabled = true;
                        document.getElementById('ctl00_ContentPlaceHolder1_btnSaveResult').disabled = true;
                        document.getElementById('ctl00_ContentPlaceHolder1_btnContact').disabled = true;
                        }
                    else if (cell = 'APPT') {
                        document.getElementById('ctl00_ContentPlaceHolder1_ddlResults').disabled = false;
                        document.getElementById('ctl00_ContentPlaceHolder1_btnSaveResult').disabled = false;
                        document.getElementById('ctl00_ContentPlaceHolder1_btnContact').disabled = false;
                        }
                 }

  • 2907
    Suggested Answer
    posted

    Hi,

     

    I could see syntax errors in the script.

     

    Try replacing var type = grid.Rows[grid.ActiveRow.Index].Cells[15].Text as follows:

     

    var type = grid.Rows.getRow(grid.getActiveRow().Index).getCell(15).getValue();

     

    I think this should remove script error.

     

    Use this link for online documentation of infragistics to get further details about client side object model (CSOM):

     

    http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR3.5/

    In above link navigate: ASP.NET -> Clint side object model reference (CSOM) -> Web Grid CSOM -> Web grid CSOM

     

    Refer this link if you are using different version:

    http://ko.infragistics.com/support/documentation.aspx#OnlineDocumentation

     

    I hope this would help you.