Using YAHOO.util.Dom.hasClass on datatable cell

View: New views
1 Messages — Rating Filter:   Alert me  

Using YAHOO.util.Dom.hasClass on datatable cell

by juliebonniedaisy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm stuck trying to check if a datatable cell has a class.  

I added the class to the cell with Y..addClass but I can't seem to return if the cell has the class.  i see in firebug that the class "edit-button" is being assigned to the div in the td.  My console.log on the last line doesn't not return true like I expect though.  Thanks for the help.

                // edit Record ToolTip
                var edit = function(el, oRecord) {
                        // console.log("XMLDocID: " + oRecord.getData('XMLDocID') + ", AuthorID: " + oRecord.getData('AuthorID') + ",  EditorID: " + oRecord.getData('EditorID') + ",  ReviewerID: " + oRecord.getData('ReviewerID') + ",  PublisherID: " + oRecord.getData('PublisherID'));
                        if(oRecord.getData('AuthorID') ==YAHOO.techdocs.myuserid || oRecord.getData('Editor') ==YAHOO.techdocs.myuserid) {
                                YAHOO.util.Dom.addClass(el, 'edit-button');
                        }
                };


-------------
//onCellClick to Delete Record with Ajax Function
                var target, column, record;
                var onCellClick = function(oArgs) {
                        target = oArgs.target; // cell element
                        column = this.getColumn(target); // column reference
                        record = this.getRecord(target); // record object
                        var curXMLDocID = record.getData("XMLDocID");
console.log("cell class is: " + YAHOO.util.Dom.hasClass(target,'edit-button'));
.....