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 8751453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:03:07+00:00 2026-06-13T13:03:07+00:00

I have setup a datatables based on the following html <script> $(‘#tableListing’).dataTable({ bAutoWidth :

  • 0

I have setup a datatables based on the following html

  <script>
       $('#tableListing').dataTable({
        "bAutoWidth" : true,
        "bProcessing" : true,
        "bServerSide" : true,
        "sAjaxSource" : '${actionUrl}',
        "aoColumns":[ 
                       { "sTitle": "ID", "mData": "id" },
                       { "sTitle": "Username", "mData": "userName" },
                       { "sTitle": "Password", "mData": "password" }
                     ]

            }
    });
    </script>

<table id="tableListing" class="display datatable">
            <thead>
                <tr>
                    <th><spring:message code="columnLabel.id" /></th>
                    <th><spring:message code="columnLabel.username" /></th>
                    <th><spring:message code="columnLabel.enabled" /></th>
                </tr>
            </thead>
</table>

And the JSON response from server is [1,"abiieez",true] and it works nicely. However I have changed the response from server into something like:

*Edit (updated JSON response) *

{
    "iTotalDisplayRecords": 11,
    "iTotalRecords": 11,
    "aaData": "[{\"creationTime\":0,\"enabled\":true,\"id\":1,\"loginDuration\":0,\"online\":false,\"password\":\"asdasd\",\"userName\":\"abiieez\"},{\"creationTime\":0,\"enabled\":false,\"id\":105,\"loginDuration\":0,\"online\":false,\"password\":\"asdasd\",\"userName\":\"asd1212123\"},{\"creationTime\":0,\"enabled\":false,\"id\":106,\"loginDuration\":0,\"online\":false,\"password\":\"asdsdasd\",\"userName\":\"asdasd23123\"},{\"creationTime\":0,\"enabled\":false,\"id\":107,\"loginDuration\":0,\"online\":false,\"password\":\"asdsdasd\",\"userName\":\"asdasd23123\"},{\"creationTime\":0,\"enabled\":false,\"id\":108,\"loginDuration\":0,\"online\":false,\"password\":\"anak jalanan\",\"userName\":\"alibaba90\"},{\"creationTime\":1351338218227,\"enabled\":false,\"id\":109,\"loginDuration\":0,\"online\":false,\"password\":\"asdasdasda\",\"userName\":\"asdasdasda\"},{\"creationTime\":1351338263527,\"enabled\":false,\"id\":110,\"loginDuration\":0,\"online\":false,\"password\":\"asdasdasda\",\"userName\":\"asdasdasda\"},{\"creationTime\":1351338265078,\"enabled\":false,\"id\":111,\"loginDuration\":0,\"online\":false,\"password\":\"asdasdasda\",\"userName\":\"asdasdasda\"},{\"creationTime\":1351338266329,\"enabled\":false,\"id\":112,\"loginDuration\":0,\"online\":false,\"password\":\"asdasdasda\",\"userName\":\"asdasdasda\"},{\"creationTime\":1351338267247,\"enabled\":false,\"id\":113,\"loginDuration\":0,\"online\":false,\"password\":\"asdasdasda\",\"userName\":\"asdasdasda\"}]",
    "sEcho": "1"
}

The above json is not accepted by the datatables, I believe because the number of columns do not match.

Is there a way for me to retrieve this json object and pick which columns I would like to show on the tables on the client side ?

  • 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-13T13:03:08+00:00Added an answer on June 13, 2026 at 1:03 pm

    You can use mData property in aoColumns like this:

     $(document).ready(function() {
                $('#tableListing').dataTable({
                   "aoColumns":[ 
                                 { "sTitle": "user", "mData": "userName" },
                                 { "sTitle": "pass", "mData": "password" },
                                 ...
                               ]
                    "bAutoWidth" : true,
                    "bProcessing" : true,
                    "bServerSide" : true,
                    "sAjaxSource" : '${actionUrl}'
                });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this datatable setup: $(document).ready(function() { $('#RectifiedCount').dataTable( { "bJQueryUI": true, "bProcessing": true, "aLengthMenu":
i have setup an overlay script to enable me to display an overlay popup
I am using Datatables Collapsible/Expandable Grouping. http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/collapsibleGroups.html I have configured it so that all
Hello I have a Dynamic DataTable Created at runtime. The Setup is like so
I have an HTML table setup in a visualforce page with some functionality that
I have a data table setup (http://datatables.net/) and I am trying to have an
I'm using datatables with the jeditable plugin, I have it setup to update directly
I have setup a simple Google Chart by following the example on this page:
I have the following set up: HighChart Graph -------------------- DataTable Header Month | Day
I have setup airbrake in my app but it doesn't seem to log any

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.