Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:15:11+00:00 2026-06-01T09:15:11+00:00

I’ve add DataTables Editable to my table to able to add and delete some

  • 0

I’ve add DataTables Editable to my table to able to add and delete some rows.
The add part works great, but I’m having some problem with the delete part, because I can’t select the rows.

By what I’ve seen in the example all I’ve to do is to add the delete URL, something like this:

.makeEditable({sDeleteURL: “/DeleteURL”});

But that dosent make my rows selectable so I can delete anthing.

My full code is:

$(function () {
    var oTable = $('.table-@Model.Numero').dataTable(
        {
            "oLanguage": { "sUrl": "/LanguageURL" },
            "bProcessing": true,
            "bFilter": false,
            "sPaginationType": "full_numbers",
            "iDisplayLength": 10,
            "bLengthChange": false,
            "aoColumnDefs": [{ "sClass": "center-col", "aTargets": ['align-center-col'] },
                { "sClass": "read_only", "aTargets": ['read-only-col'] },
                { "sClass": "small-width-col", "aTargets": ['small-col'] }],
            "aaSorting": [[0, "desc"]],
            "bScrollCollapse": true,
            "bServerSide": true,
            "sAjaxSource": '/DataURL',
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "Numero", "value": $(this).find("#Numero").val() });
                $.ajax({
                    "dataType": 'json',
                    "type": "POST",
                    "url": sSource,
                    "data": aoData,
                    "success": fnCallback
                });
            }
        }).makeEditable({
            sAddNewRowFormId: 'form-@Model.Numero',
            sAddNewRowButtonId: 'btn-@Model.Numero',
            btnDeleteRow: 'btn-del-@Model.Numero',
            sAddURL: "/AddURL",
            sDeleteURL: "/DeleteURL"
        });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:15:12+00:00Added an answer on June 1, 2026 at 9:15 am

    I’ve personally been playing around with getting the datatables delete function to work for one of my projects.

    What I’ve found is I needed to include the jquery-ui.js script in the head of the document.

    I also discovered that you need to format your table rows like this. <tr id="1"> so that datatables can automatically grab the correct id # from the selected row and pass it on to your php page for further processing.

    Datatables can automatically add an id to each table row through the use of DT_RowId special property.

    If you have set up datatables to use server side implementation, then you can include DT_RowId in the JSON data returned from the server in response to the ajax request .

    For example JSON format:

    { 
     "sEcho": 1,
     "iTotalRecords": "1",
     "iTotalDisplayRecords": "1",
     "aaData": [
      {
        "DT_RowId": "1",
        "engine": "Trident",
        "browser": "Internet Explorer 4.0",
        "platform": "Win 95+",
    "version": "4",
        "grade": "X"
      }
     ]
    }
    

    Here is my example mockup code. Server side implementation isn’t included with this example I’m just using the example source objects.txt that came with datatables for an example.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html> 
      <head> 
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
        <script src="datatables/media/js/jquery.dataTables.js"></script> 
        <script src="examples/examples_support/jquery.jeditable.js"></script> 
        <script src="http://jquery-datatables-editable.googlecode.com/svn/trunk/media/js/jquery-ui.js"></script> 
        <script src="datatables/media/js/jquery.datatables.editable.js"></script> 
        <style type="text/css">
            @import "datatables/media/css/demo_table.css";
            @import "datatables/media/css/demo_table_jui.css";
            @import "examples/examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css";
        </style> 
        <script> 
            $(document).ready(function() {
                var anOpen = [];
                var sImageUrl = "/datatables/examples/examples_support/";
    
                var oTable = $('#example').dataTable({
                    "sPaginationType": "full_numbers",
                    "bJQueryUI": true,
                    "bProcessing": true,
                    "sAjaxSource": "/datatables/examples/ajax/sources/objects.txt",
                    "aoColumns": 
                    [
                        {
                           "mDataProp": null,
                           "sClass": "control center",
                           "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">'
                        },
                        { "mDataProp": "engine" },
                        { "mDataProp": "browser" },
                        { "mDataProp": "grade" }
                    ]
                }).makeEditable({
                    sDeleteURL: "DeleteData.php",
                    //Converts to JQuery UI button (full list of options on http://jqueryui.com/demos/button)
                    oDeleteRowButtonOptions:
                    {
                        label: "Remove",
                        icons: {primary:'ui-icon-trash'}
                    },
                    //Additional Paramaters can be sent for processing...
                    oDeleteParameters:
                    {
                        action:"delete_dt_projects_record",
                        dtSecurity:"9999999999"
                    }
                });
                //For Expandable Collapsible Rows
                $('#example td.control').live( 'click', function () {
    
                    var nTr = this.parentNode;
                    //var projID = $(this).closest("td").next().text();
                    //console.log(projID);
                    //console.log(anOpen);
                    //console.log(nTr);
                    var i = $.inArray( nTr, anOpen );
                    //console.log(i);
                    if ( i === -1 ) 
                    {
                        $('img', this).attr( 'src', sImageUrl+"details_close.png" );
                        var nDetailsRow = oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
                        $('div.innerDetails', nDetailsRow).slideDown();
    
                        anOpen.push( nTr );
                    }
                    else 
                    {
                    $('img', this).attr( 'src', sImageUrl+"details_open.png" );
                    $('div.innerDetails', $(nTr).next()[0]).slideUp( function () 
                        {
                            oTable.fnClose( nTr );
                            anOpen.splice( i, 1 );
                        });
                    }
                });
                function fnFormatDetails( oTable, nTr )
                {
                  var oData = oTable.fnGetData( nTr );
                  var sOut =
                    '<div class="innerDetails">'+
                      '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
                        '<tr><td>Rendering engine:</td><td>'+oData.engine+'</td></tr>'+
                        '<tr><td>Browser:</td><td>'+oData.browser+'</td></tr>'+
                        '<tr><td>Platform:</td><td>'+oData.platform+'</td></tr>'+
                        '<tr><td>Version:</td><td>'+oData.version+'</td></tr>'+
                        '<tr><td>Grade:</td><td>'+oData.grade+'</td></tr>'+
                      '</table>'+
                    '</div>';
                  return sOut;
                }
            });
    
        </script> 
      </head> 
      <body> 
        <div style="width:900px">
        <div class="add_delete_toolbar">
            <button id="btnDeleteRow">Delete</button>
        </div>
          <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
        <thead>
            <tr>
                <th></th>
                <th>Rendering engine</th>
                <th>Browser</th>
                <th>CSS grade</th>
            </tr>
        </thead>
        <tbody></tbody>
        </table>
        </div> 
      </body> 
    </html> 
    

    NOTE You may have to change the script and Style URL paths to where yours are located in order to see a working example.

    Update: You also need to manually include this anywhere in your HTML source.

    <button id="btnDeleteRow">Delete</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.