I have a simple HTML table, where first "td" is customized to be an ID input checkbox :
<table class="table" id="mytable">
<thead>
<tr>
<th scope="col">Col1</th>
<th scope="col">Col2</th>
<th scope="col">Col3</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type=checkbox name="id-1" value=1></td>
<td class="id">ID</td>
<td class="name>NAME</td>
</tr>
<tr>
<td><input type=checkbox name="id-2" value=2></td>
<td class="id">ID</td>
<td class="name>NAME</td>
</tr>
....... A lot of more rows, some already checked ..........
</tbody>
</table>
Then I am using Jquery Datatable to "enhance" the table to be a Datatable :
$('#mytable').DataTable();
Since some values could be already checked during table rendering,
I'm trying to figure out the most effective way to add a "show only selected/show all" button that filters the datatable and only show checked checkbox.
Is there a way to do it directly with Datatable without involving external code or what's the best way to achieve this?
I read about a legacy extension named "TableTools" that should ease this, but it seems being deprecated from a long time.
Related
Im new to coding and i need below solution to one of my project. i'll try my best to explain. Im using google appscript.
I have a HTML file with an ID agent_email_id, when i change the email id (type in an email id) from this input, i want the rest of the input fields (like, name, emp id, supervisor name) to get updated with the data from google sheet for this specific email.
is this possible ? how should i proceed
Any help would be appreciated.
Note: i do not have any code handy, trying to automate certain audits.
<form id="myForm" onsubmit="handleFormSubmit(this)">
<table class="table table-bordered table-striped table-condensed" style="border-style: solid">
<tr>
<td class="" colspan="6">Mandatory Fields </td>
</tr>
<tr>
<th class="">Agent EMP ID</th>
<td class="text-center"><input name="agent_ID" value="agent_ID" type="hidden" class="">
<span class="">agent_ID</span></td>
<th class="">Agent Name: </th>
<td class="text-center"><span class=""></span><input name="agent_name" type="hidden" value="agent_name" class=""><span class="">agent_name</span></td>
<th class="">Agent Email ID </th>
<td class="text-center"><input name="agent_email_ID" id="a_email_id" type="text" value="" class=""></td>
</tr>
For get any information form google sheet using AppScript you have create a API with google sheet.
than you will able to fetch data with email and any other params.
But I want to tell you thats not easy for anyone without learning javascript.
I have this HTML code in my JSP
<table>
<tr>
<td width="50%" > type your article :
</td>
<td width="50%">
<input type="text" name="article" size="50"/>
</td>
</tr>
</table>
I have in MYSQL database a table 'article' in which i have a column 'designation' , I want to propose a choice of 'designation' to the user according to what is being written.
note: i can not use a dropdownlist because i have more than 1000 designations
Thanks in Advance.
I think you can solve the problem using JQuery Lookup.
I have a dynamic table where I don't know the number of columns. But I want when the number of td is less than usual, first column auto colspan to make <td>s center.
For example, I have four columns. I add a <tr> where There's are only two columns. I want to set the two 2nd and 3rd position to make it center.
Here my last <td>s become center. I want to achieve this effect. If it is possible with CSS, i'll highly appreciate.
I've the HTML code of the table. But I can't understand how to do it.
HTML:
<table>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr >
<td>1</td>
<td>1</td>
</tr>
</table>
Hey guys I have a question and I'm looking for help to change this code a lil bit cause I'm struggling to do this for the last hour and I can't seem to figure it out how to change it.
This script works exactly how I want it to be. I can add an input field, I can delete input field and what's the most important it sum up all values.
https://jsfiddle.net/btxjkgr4/3/
What I need is to change this script that It can instead of creating div's, create next table rows with 3 columns to fit this table and sum up all values from 3rd column in each row
<table class="table" id="tab_klasa1">
<tr>
<th class="tg-031ec" colspan="3">Class</th>
</tr>
<tr>
<td class="tg-031ec">Name</td>
<td class="tg-031ec">Profile</td>
<td class="tg-031ec">No. Users</td>
</tr>
<tr>
<td class="tg-031e">A</td>
<td class="tg-031e"><input class="input_t4" type="text" name="fname"></td>
<td class="tg-031e"><input class="input_t4" type="text" name="fname"></td>
</tr>
<tr>
<td class="tg-yw4lcr" colspan="2">Total:</td>
<td class="tg-yw4l"><input class="input_t4" type="text" name="fname"></td>
</tr>
</table>
I applied table in this jsfiddle. I'd really appreciate for help.
Mornin' StackOverflow.
I am having some neurological problems trying to find sibling columns of a checkbox.
Table structure is (roughly) as follows:
<tr>
<td><input CHECKED type="checkbox" /></td>
<td data-context="key 1">Sibling 1</td>
<td data-context="key 2">Sibling 2</td>
<td data-context="key 3">Sibling 3</td>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td data-context="key 4">Sibling 1</td>
<td data-context="key 5">Sibling 2</td>
<td data-context="key 6">Sibling 3</td>
</tr>
Now, what I have to do, is get all the sibling elements of the checked checkbox (all the elements within the which checkbox has been checked). I've tried using Jquery's .siblings() and .each() on that, however it turns up with nothing.
I'm obviously missing something important.
I'm not sure what you want to do with the data but you can use jquery is.(":checked") and then find the .parent().siblings() of the input to get the info (input is a child so you need to back out to the parent level then you can look at the siblings)
JSFIDDLE
As the others have stated, I wasn't thinking straight.
I needed to get the parent of the , and then it's siblings. Thanks for the swift answers, upvotes and accepts for all.