How To I will hide action button and my datatable?
How To I will hide action button and my datatable?
giash
Posts: 29Questions: 4Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
Are you wanting to hide the Action column? If so use
columns.visible
. If this doesn't help then please provide more details of what you want with a link to your page or test case replicating what you have so we can see what you have to offer suggestions.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Kevin Thanks For Response, Ok I will share my code now.
How to Share my code here?
hello Kevin please help me?
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Please provide more details of what you want to do and how this relates to Datatables. You haven't provided you Datatables config.
Kevin
**
When I will Delivered button click and save my data then, I need my datatable action button is off.**
Here is my Code :
<?php
$i = 1;
$qry = $conn->query("SELECT r.*,CONCAT(c.firstname,', ',c.contact,' ',c.lastname,' ',c.email,' ',c.middlename) as client from
repair_listr inner join client_list c on r.client_id = c.id order by unix_timestamp(r.
date_created) desc ");
while($row = $qry->fetch_assoc()):
?>
<tr class="table-info">
<td class="text-center"><?php echo $i++; ?></td>
<td class=""><?php echo date("F d-m-y g:i a",strtotime($row['date_created'])) ?></td>
<td><?php echo ($row['code']) ?></td>
<td class=""><p class="truncate-1"><?php echo ucwords($row['client']) ?></p></td>
<td class="text-center">
<?php
switch ($row['status']){
case 0:
echo '<span class="rounded-pill badge badge-secondary">In-Progress</span>';
break;
case 1:
echo '<span class="rounded-pill badge badge-primary">Approved</span>';
break;
case 2:
echo '<span class="rounded-pill badge badge-info">Under Diagnosis</span>';
break;
case 3:
echo '<span class="rounded-pill badge badge-warning">QC Pending</span>';
break;
case 4:
echo '<span class="rounded-pill badge badge-success">QC Passed</span>';
break;
case 5:
echo '<span class="rounded-pill badge badge-success">Repair OK</span>';
break;
case 6:
echo '<span class="ml-4 rounded-pill badge badge-danger">Same Back Delivery</span>';
break;
case 7:
echo '<span class="rounded-pill badge badge-danger">Repair Fail</span>';
break;
case 8:
echo '<span class="rounded-pill badge badge-success">Delivered Done</span>';
break;
case 9:
echo '<span class="rounded-pill badge badge-danger">Delivered-Payment Due</span>';
break;
}
?>
</td>
Doesn't look like you are using Datatables to render the button but are rendering directly into HTML. In your click event for the button, once the data is saved, apply the disabled attribute to the button. I'm not sure how Datatables is involved with this process.
If you want us to provide a more specific answer then please post a link to your page or a test case replicating the issue so we can see your code flow.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Please Check here my code zip
when I will choose my delivered option, and Save my data then action button row or ID is hide.
That is a lot of code to look through to try and understand your solution. Its very difficult to try understanding another's solution with just the code. Especially when it spans multiple files. Point us to the specific code (click event) you have questions about.
The only Datatables code I see is this to display the table:
I don't see anything else in the code that is Datatables specific. As I said before find the click event for the button and when the data is updated apply whatever changes you want to the button. Stack Overflow is a good resource for general Javascript and jQuery questions.
Kevin
Ok Thanks tomorrow I will Try..
Are you saying you want to remove the whole row from the table? if yes, then in your click event for the action button you can get the Datatables row similar to this example. You can use
row().remove()
to remove the row.The code you are posting doesn't not provide us with the information we need. Maybe start by posting the click event handler used to process the delivered option.
Kevin
Action button I need to hidden, when I will clicked delivered option?
thanks
PLEASE post the click event or relevant Javascript code that runs when you click the delivered option. There is too much code for us to look through to try finding this code.
Kevin
I built a very simple example:
https://live.datatables.net/galutonu/1/edit
It removes the clicked Action button. Is this what you are looking for when processing the delivered option? If it is then maybe you can merge this into your delivered code.
Kevin
I need as your code,but not here when I will choose delivery option and save the data then my Action button need to hide.
Please See the my 1,2,3 step?
Great, I understand the screenshots you have posted multiple times. We either need a link to your page so we can follow your code in a running environment or you need to post the relevant Javascript code that runs when you click buttons 1, 2 and 3. You need to point us to the code. There is too much code for us to just look at to understand your solution.
Kevin
Please Check this Link
https://newtechrsms.net/
I see in input asking for the Complaint ID. Please provide the steps to see the problem.
Kevin
please again clear me?
Complaint ID is individual number like id.
Do you need User and PassW?
https://newtechrsms.net/admin/login.php
Please provide the exact steps needed to run the test case. What exactly needs to be typed in and clicked to be able to perform steps 1, 2 and 3 above.
Kevin
here I send user and passw?
hello ?
Any one here? I need your help.
I need this Same as like this link below?
https://stackoverflow.com/questions/53762231/disable-button-dynamically-in-datatable-table-column-data
You might need to wait just a little longer before bumping your post in future. If it is really urgent then the support packages might be of interest to you.
It looks like the SO post you linked to has an accepted answer. Does that not work for you?
I'd need a user name and password to access your site (also, I probably won't be able to do so until tomorrow now, so please don't keep bumping your post, it won't get a reply any quicker).
Allan
Please here details
https://datatables.net/forums/discussion/75885/edit-button-need-to-disabled#latest