I think all you need to do is change

  buttons: {
    'Volunteer': function() { onclick=add() },
    'Cancel': function() { ... }
  }

to

  //anonymous function (callback) which calls the add function
  buttons: {
    'Volunteer': function() { add(); },
    'Cancel': function() { ... }
  }

or

  //add is the callback function
  buttons: {
    'Volunteer': add,
    'Cancel': function() { ... }
  }

This is the right forum for questions about the tableEditor plugin. If you
have any further questions about the UI Dialog plugin, please post them to
the jQuery UI list:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard

Richard D. Worth
http://rdworth.org/

On Sat, Jun 28, 2008 at 3:58 PM, ktpmm5 <[EMAIL PROTECTED]> wrote:

>
>
>  I've read all the other info about adding a row to a table and I just
> can't
> get it to work.  I've got my dialog popping up with  two buttons.  When the
> user clicks Volunteer, I want an empty row to appear at the bottom of my
> table and the "Volunteer" button to change to "Save".  The user would enter
> their info and press save.  The data is then saved to the db. I've tried
> tableEditor, but can't even get a javascript error to troubleshoot.  Can
> someone help?  I promise to write this up in the FAQ later....here's code
> to
> call the popup:
>
> [code]
> var Demo = {
>   three: function() {
>   var url = 'v_concessions.php?i='   "5";
>   $('<iframe id="popup" src="'   url   '" />').addClass("flora").dialog(
>    {
>        title: "St. Mary Ryken",modal: true,overlay:
>       {
>             opacity: 0.5,
>             background: "grey"
>       },
>        width: 850,
>         height: 400,
>         buttons:
>         {
>                'Volunteer': function() {
>                      onclick=add()},
>                'Cancel': function() {
>  $(this).dialog('destroy')}
>          }
>    });
> }
> [/code]
>
> Here's my add function:
> [code]
> function add(){
>      alert("clicked add");
>      var options = {
>             CLASS: 'newRow',
>             VALUES: {
>                     email: '[EMAIL PROTECTED]',
>                      lastname: '',
>                      firstname: '',
>                      homephone: ''
>              }
>      };
>
>          jQuery.tableEditor.lib.appendRow(options);}
> [/code]
>
>
> --
> View this message in context:
> http://www.nabble.com/add-new-row-to-table-tp18174322s27240p18174322.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>

Reply via email to