Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Re: Help: Data Table, pass the status of checkboxes via post

Expand Messages
  • Satyam
    On the listener to some sort of submit button you can build the URL argument list by looping through the recordset: var recset =
    Message 1 of 3 , Aug 2, 2008
      On the listener to some sort of submit button you can build the URL argument list by looping through the recordset:

      var recset = this.myDataTable.getRecordset();
      var recsetlen = recset.getLength();
      var urlargs = '';
      for (var i = 0 ; i < recsetlen;i++) {
          var rec = recset.getRecord(i);
          if (rec.getData('id')) {
             urlargs += '&' + escape(rec.getData('Name')) + '=1';

      or something like that.  Then you append the whole of it to the base URL and you either use it in a call to asyncRequest or assign it to window.location.


      mattixtech wrote:
      --- In ydn-javascript@yahoogroups.com, "mattixtech" <mattixtech@...>
      First off I'm new here and fairly new to programming in general so if
      this question sounds very noobie that's why :P.
      I have created a data table that will be storing several rows of
      content with a check box for each row. I would like the user to be
      able to place a check beside multiple rows and then submit the data
      table similar to a form submit via POST.
      I have a php script to check the values passed to it and if it
      determines the check box is checked for a specific row it deletes that
      row from the database.
      I am just wondering what the code would be to submit the status of all
      the check boxes to a php script.
      Oops. I wasn't very specific.
      The data table I am using is the yui data table.
      Here are my columns:
       var myColumnDefs = [
                  {key:"id",label:' ',formatter:"checkbox"},
      sortable:true, resizeable:true},
                  {key:"Location", sortable:true, resizeable:true},
      Here is my checkbox checking code:
           this.myDataTable.subscribe("checkboxClickEvent", function(oArgs){
             var elCheckbox = oArgs.target;
             var elRecord = this.getRecord(elCheckbox);
             var name = elRecord.getData("id");
             var elColumn = this.getColumn(elCheckbox);
      Yahoo! Groups Links
      <*> To visit your group on the web, go to:
      <*> Your email settings:
          Individual Email | Traditional
      <*> To change settings online go to:
          (Yahoo! ID required)
      <*> To change settings via email:
      <*> To unsubscribe from this group, send an email to:
      <*> Your use of Yahoo! Groups is subject to:
      No virus found in this incoming message.
      Checked by AVG - http://www.avg.com 
      Version: 8.0.138 / Virus Database: 270.5.10/1585 - Release Date: 01/08/2008 6:39
    Your message has been successfully submitted and would be delivered to recipients shortly.