Skip to Content
0
Former Member
Aug 08, 2005 at 03:45 PM

Check TableView Row Selection in Javascript

23 Views

Hi everyone,

I am trying to check in my javascript code if a row has been selected in my tableview. I looked at the discussion in the following thread:

Check if a row is selected in TableView in javascript

I tried to use some of the methods suggested by in that thread but it doesn't seem to be working correctly.

Here is my javascript code:

function warn(){

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var table = eval(func("tblCalendarList"));

if(table.getSelectedRow() != null) {

var confirmed = window.confirm("You are about to permanently delete this record. To continue press OK");

if(confirmed){

document.all.<%=buttonDelete%>.click();

}

else {

htmlbevent.cancelSubmit = true;

}

}

}

The code is supposed to check if a row is selected. If a row is selected, the code should through a warning message. In case no row is selected, the code should just continue submitting the form without throwing any messages.

I am not sure that I am correctly retrieving the tableview object.

Currently the code table.getSelectedRow() returns null whether or not a row is actually selected.