[ 4 posts ]

Syntel

  • Username: Syntel
  • Joined: Thu Apr 08, 2010 11:08 pm
  • Posts: 1
  • Offline
  • Profile

Getting the id attribute of the table element in datatable

Post Posted: Thu Apr 08, 2010 11:16 pm
+0-
Is there a way to access the id attribute for the table element generated by yui datatable?Does yui datatable set the id attribute for the table element?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Getting the id attribute of the table element in datatab

Post Posted: Thu Apr 08, 2010 11:40 pm
+0-
You can use method getTableEl() to reach the actual <table> element and from it, anything you want.

Brian McCullough

  • Username: bdmc
  • Joined: Fri May 22, 2009 11:05 am
  • Posts: 64
  • IRC: bdmc
  • Offline
  • Profile

Re: Getting the id attribute of the table element in datatab

Post Posted: Fri Apr 09, 2010 10:17 am
+0-
Satyam,

Butting into another thread, but I think that I was trying to find the same thing just now.

I have a Radio Button in my Data Table that I use to signal "Delete." ( I could use a check box, but I think that the concept is the same. )

I then pop up a Dialog that asks if they really want to delete that record. If they delete it, no problem.

However, if they choose not to delete the record, I would like to turn off the radio button or check box or whatever. It code that is connected directly to the "radioClickEvent" or "checkboxClickEvent", this is easy, because I can manipulate oArgs.target.checked. However, the Cancel button of the Dialog is not connected to oArgs.target, as far as I know.

Could I use your answer above to change the value in the HTML Table and would that be correct for the Data Table, or is there a better way?


Thanks,
Brian

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Getting the id attribute of the table element in datatab

Post Posted: Fri Apr 09, 2010 11:33 am
+0-
Normally, you would store the value (checked or not) of the checkbox or radioButton on the Record. That would ensure that even if at a later time you decide to do pagination, the state of the rows selected on one page is kept across the DataTable, whether those rows are visible or not. Thus, restoring the clear state of those checkboxes can be done by going through the RecordSet and on each Record, using setData to set that field to false and then re-render the DataTable.
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum