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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:52:05+00:00 2026-06-12T19:52:05+00:00

I downloaded the Jquery Data Table and the Jquery DataTable.Filter Plugin. Here is the

  • 0

I downloaded the Jquery Data Table and the Jquery DataTable.Filter Plugin.

Here is the code i am working on.

var oTable = $('#myDataTable').dataTable({
        "bServerSide": true,
        "sAjaxSource": "/User/DataProviderAction",
        "bJQueryUI": true
    });

    oTable.columnFilter({ sPlaceHolder: "head:before",
        aoColumns: [{ type: "select", values: ["Box Office", "Concessions"] },
                    { type: "select",values: ["Administrator","Sales People"]},
                    {type: "text"}

                    ]
    });

QUESTION: Instead of hardcoding the values in aoColumns how would I go about getting it to load values from the database. I am using MVC. I do have a method set up returning string values in my repository, if that helps.

  • 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-12T19:52:08+00:00Added an answer on June 12, 2026 at 7:52 pm

    You could retreive your database values from from your controller by doing a jquery ajax call and then setting Javascript variables to the response value which you can use in your datatable. I’ve got a pseudo example below.
    Your controller would return a Json response, which could be a Model:

    YourModel model = new YourModel();
    model.DBList1 = SomeValue;
    model.DBList2 = SomeOtherValue;
    return Json(model); // Use return Json(model, JsonRequestBehavior.DenyGet); if you want to limit access to post only.
    

    If your doing a Post from the ajax call, remember to include the [HttpPost] attribute on the Controller Action.

    $(document).ready(function () {
    
    var List1;
    var List2;
    
    $.ajax({
        type: "POST",
        url: "Controller URL",
        contentType: "application/json; charset=utf-8",
        ...
        ...
        success: function(response) {
        List1 = response.DBList1;
        List2 = response.DBList2;
        }
    });
    
    
    var oTable = $('#myDataTable').dataTable({ 
        "bServerSide": true, 
        "sAjaxSource": "/User/DataProviderAction", 
        "bJQueryUI": true 
        }); 
    
        oTable.columnFilter({ sPlaceHolder: "head:before", 
        aoColumns: [{ type: "select", values: List1 }, 
                    { type: "select",values: List2 }, 
                    {type: "text"} 
    
                    ] 
        }); 
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning jQuery UI. I downloaded a code in which the author made
Can anybody help me with the jQuery plugin jqGrid? I downloaded jqGrid 4.4.5 and
Hoping someone can give me a hand here.... I have the DataTables jquery plugin
I'm trying to inject HTML code downloaded from URL into my page. Here the
I am using jquery validation plugin 1.9.0 . I have downloaded the plugin from
I've downloaded jquery-ui to my webapp which has a build.xml for compressing and minifying.
Someday i've downloaded a very nice jquery editor but i lost it and i
I downloaded the latest version of JQM and saw jquery.mobile.structure-1.1.0-rc.1.css. Q: What's that used
i am using jquery for first time in a phonegap eclipse application.i have downloaded
On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });

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.