Click here to Skip to main content
15,845,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
in each row I have buttons like clarify->allot->start/paused ->quality check->send final stage
here am using PHP variable for drawing stage and am giving condition like if stage ==1 show clarify button else if stage == 2 show this button like this

What I have tried:

<table id="example" class="stripe row-border order-column" width="100%">
<thead>
<tr>
<th>Drawing</th>
<th style="display:none">Overview</th>
<th>Stage</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>BW101-01</td>
<td>1</td>
<td><button type="button" id="clarify">Clarify</button>
    <button type="button" id="allott">Allott</button>
    <p id="satge3">Started / Paused</p>
    <button type="button" id="correctit">correctit</button>
    <button type="button" id="send">send</button></td>
</tr>
<tr>
<td>BW102-02</td>
<td>2</td>
<td>  <button type="button" id="clarify">Clarify</button>
      <button type="button" id="allott">Allott</button>
      <p id="satge3">Started / Paused</p>
      <button type="button" id="correctit">correctit</button>
      <button type="button" id="send">send</button></td>
</tr>                 
</tbody>
</table>



<pre>$(document).ready(function(e) {
var table = $('#example').DataTable();
var Stage = &lt;?php echo $stage_ID?>; //i get this from database
alert(Stage);

if (Stage == 1) {
$("#allott").hide();
$("#clarify").show();
$("#satge3").hide();
$("#correctit").hide();
$("#send").hide();
} else if (Stage == 2) {
$("#allott").show();
$("#clarify").hide();
$("#satge3").hide();
$("#correctit").hide();
$("#send").hide();
}



});</pre>
Posted
Updated 20-Jul-21 3:05am
Comments
thejashwini l 20-Jul-21 6:55am    
Kindly help me out of this ASAP
Richard MacCutchan 20-Jul-21 7:57am    
You forgot to explain what the problem is.
thejashwini l 20-Jul-21 8:08am    
What I want to achieve is in a table in all the rows I have to give some buttons based on some stages of work like
if there is so many drawing with different status like clarify or allot or its started or correction or send these are stages/buttons I want to display on click of an individual button in an individual row I want to update or show next stage button in that row
Richard MacCutchan 20-Jul-21 9:24am    
Yes, we know what you want, but we do not know what problem you are having.

1 solution

Two things:
1) It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
Everybody wants a solution as soon as possible, so getting "all demanding" 5 minutes after you post your "question" does not make a good impression on anybody ...

2) While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
Comments
thejashwini l 20-Jul-21 7:58am    
Sorry for the behavior and kindly help me out of this because am trying from a week so I approached like that sorry for that
thejashwini l 20-Jul-21 8:02am    
What I want to achieve is in a table in all the rows I have to give some buttons based on some stages of work like
if there is so many drawing with different status like clarify or allot or its started or correction or send these are stages/buttons I want to display on click of an individual button in an individual row I want to update or show next stage button in that row

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900