ahsanjr / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

Add New Row form dialog buttons not working #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I can't get the Ok|Cancel buttons to show/work correctly when using the example 
from 
http://jquery-datatables-editable.googlecode.com/svn/trunk/customize-buttons.htm
l along with jQuery 1.5.1 and jQuery-ui 1.8.2.  All I get is "0" & "1" for 
button labels.  When I click on either button I get "Uncaught TypeError: Object 
<#Object> has no method 'apply'" in jquery-ui.

I tried upgrading to the latest jquery and jquery-ui libraries with no luck.

Any help is greatly appreciated and thanks for the excellent plugin!

Original issue reported on code.google.com by jame...@gmail.com on 10 Nov 2011 at 10:56

GoogleCodeExporter commented 9 years ago
Do you or some online example or source code?

Original comment by joc...@gmail.com on 11 Nov 2011 at 9:08

GoogleCodeExporter commented 9 years ago
As there is no response I will assume that this is not issue anymore.

Original comment by joc...@gmail.com on 9 Feb 2012 at 9:51

GoogleCodeExporter commented 9 years ago
I'm seeing this issue as well with version 2.3.1.  the OK|Cancel buttons are 
displaying properly, and instead the labels are being set to "0" and "1".  I'm 
also seeing the "Uncaught TypeError: Object <#Object> has no method 'apply'" in 
my javascript console.  

Here is my form:

<form id="formAddNewRow" action="#">
    <h2>New User</h2>
    <fieldset id="user">
      <div>
        <label>First Name</label>
        <input type="text" name="firstName" value="" rel="0" class="required"/>
      </div>
      <div>
        <label>Last Name</label>
        <input type="text" name="lastName" value="" rel="1" class="required"/>
      </div>
      <div>
        <label>Email</label>
        <input type="text" name="email" value="" rel="2" class="required"/>
      </div>
      <div>
          <label>Password</label>
          <input type="password" name="password" value="" rel="3" class="required"/>
      </div>
      <div>
          <label>Confirm Password</label>
          <input type="password" name="confirmPassword" value="" class="required"/>
      </div>
      <div>
         <label>Type</label>
         <select name="type" rel="4" class="required">
             <option value="" 'selected'>Select User Type</option>
             <option value="intern">Intern</option>
             <option value="student">Student</option>
             <option value="coach">Coach</option>
             <option value="regAdmin">Regional Admin</option>
             <option value="other">Other</option>
             <option value="super">Super</option>
         </select>
      </div>
      <div>
        <input type="hidden" name="regDate" value="<?php date('Ymd'); ?>" rel="5"/>
      </div>
      <div>
        <input type="hidden" name="status" value="<?php ACTIVE; ?>" rel="6"/>
      </div>
      <div>
          <label>Region</label>
          <select name="region" rel="7" class="required">
            <option value="" 'selected' >Select A Region</option>
        <?php
            if(count($regions) > 0){
                foreach ($regions as $row){
                    echo '<option value="'.$row['ID'].'" >';
                    echo $row['Name'].'</option>';
                }
            }
        ?>
        </select>
      </div>
      <div>
          <label>Coach</label>
          <select name="coach" rel="8">
            <option value="" 'selected'>Select A Coach</option>
        <?php
            if(count($coaches) > 0){
                foreach ($coaches as $row){
                    echo '<option value="'.$row['Email'].'" >';
                    echo $row['FName'].' '.$row['LName'].'</option>';
                }
            }
        ?>
        </select>
      </div>
      <span class="datafield" style="display:none" rel="9"><a class="table-action-EditUser">Edit</a></span>
    </fieldset>
</form>

And here are the options I am setting:

  $('#user_table').dataTable({
    /*"sScrollX": "100%",
    "sScrollXInner": "110%",
    "bScrollCollapse": true,*/
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
        "sSwfPath": "/jquery/datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf"
    },
    "aoColumnDefs": [ 
        { "bSearchable": false, "bVisible": false, "aTargets": [ 3 ] },
        { "bSearchable": false, "bVisible": false, "aTargets": [ 5 ] }
    ]
  }).makeEditable({
      aoTableActions: [
        {
          sAction: "EditUser",
          sServerActionURL: "edit_user.php",
          oFormOptions: { autoOpen: false, modal: true }
        }
      ],
      sUpdateURL: "edit_user.php",
      sAddURL: "add_user.php",
      sDeleteURL: "delete_user.php",
      /*sAddDeleteToolbarSelector: ".dataTables_length",*/
      oAddNewRowButtonOptions: { 
        label: "Add...",
        icons: { primary: 'ui-icon-plus' }
      },
      oDeleteRowButtonOptions: {
        label: "Remove",
        icons: { primary: 'ui-icon-trash' }
      },
      oAddNewRowOkButtonOptions: {
        label: "Save"
        /*icons: { primary: 'ui-icon-check' },
        name: "action",
        value: "add-new"*/
      },
      oAddNewRowCancelButtonOptions: { 
        label: "Cancel"
        /*class: "back-class",
        name: "action",
        value: "cancel-add",
        icons: { primary: 'ui-icon-close' }*/
      },
      oAddNewRowFormOptions: {
        title: 'Add a new user',
        show: "blind",
        hide: "blind",
        width: 400
      },
      aoColumns: [{}, {}, {}, {}, {}, {}, {}, null]
  });;

Original comment by n...@thecrowns.org on 9 Apr 2012 at 4:09

GoogleCodeExporter commented 9 years ago
My comment above should have read: "The OK|Cancel buttons are *not* displaying 
properly".

Nick

Original comment by n...@thecrowns.org on 9 Apr 2012 at 4:10