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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:10:53+00:00 2026-05-26T08:10:53+00:00

Ok so I am currently populating my datatable just fine with coldfusion and everything

  • 0

Ok so I am currently populating my datatable just fine with coldfusion and everything sorts perfectly. One of the columns in my SQL is the status. Currently I am returning all results WHERE status != ‘Completed’

This has worked fine for now, but what I would really like to do is place a checkbox on the page just above the datatable and when checked it would show all records including those that are completed.

Question is, can I do some kind of callback on the check box to dynamically omit the where clause, or do I deliver ALL records to datatables and filter it there? My only worry with that is when the database gets large, returning all records may take a while and 90% of the time they will be filtered out.

Either way, code snippets would be very helpful!

Thanks

  • 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-05-26T08:10:54+00:00Added an answer on May 26, 2026 at 8:10 am

    RESOLVED

    iKnowKungFoo was right. Since I am using pagination in datatables, the query is limited to those rows anyway, eliminating the worry for the large return result.
    I implemented the following code to put a jqueryui toggle button.

    js

    $('#completed_button').bind('change', function(){
       if($(this).is(':checked')){
          $(this).button('option', 'label', 'Hide Completed');
          oTable.fnFilter('Completed',6,false);
       } else {
          $(this).button('option', 'label', 'Show Completed');
          oTable.fnFilter('',6,false);
       }
    });
    

    html

    <input class="toggle-button" id="completed_button" type="checkbox"  /><label for="completed_button">Show Completed</label>
    

    SQL

    WHERE 1 =1 
    <cfif trim(url.sSearch_6) NEQ "Completed">
       AND TS.tickets_status_id != <cfqueryparam cfsqltype="cf_sql_integer" value="13" />
    </cfif>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am populating one DataGridView in C# windows application. I have one DataTable in
Using C# / .NET 3.5. Currently I'm populating 2 DataTables one after the other
I'm currently reading in a list of tables in a SQL database and populating
I am currently building a .Net userform using C# and I am populating it
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently, if I want to output a SQL script for a table in my
I am currently populating an NSTableView through the controller (MVC design pattern) where I
I currently have a map mashup that has locations that I'm populating from my
Currently I'm populating my tableviewcells with the contents of multiple arrays representing a name,
I currently have this code for populating a list of comments to return: foreach

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.