javascript - jQuery(Mobile): button not hiding -


i'm facing weird problem. here code:

<div id="status">         <div id="armstatus">             <div id="armtext">                 <fieldset data-role="controlgroup">                     <legend>unit</legend>                     <input type="checkbox" class="cb" name="armcb_1" id="armcb_1" class="custom" data-mini="true" />                     <label for="armcb_1">arming status</label>                     <p id="armingtext"></p>                 </fieldset>              </div>         </div>         <table class="config" id="status_table">             <thead>                 <tr>                     <th colspan="4"; style= "padding-bottom: 20px; color:#6666ff; text-align:left; font-size: 1.5em">feedback status</th>                 </tr>                 <tr>                     <th>index</th>                      <th>feedback type</th>                     <th>feedback number</th>                     <th>status</th>                     <th class="chide">monitor?</th>                     <th class="chide">remove?</th>                 </tr>             </thead>             <tbody>                  <tr>                  </tr>             </tbody>               </table>        <button type="button" id="monitor" class="chide" data-role="button" data-mini="true" data-transition="fade">monitor</button>      </div> 

as show above, button monitor having same class .chide 2 table headers monitor? , 'remove?`. when called:

$(".chide").hide(); 

only monitor? , remove? column hidden monitor button still there. why so? what's wrong?

edit: seems it's working fine if standalone. suspect because of

 $('#monitor').button('enable'); 

placed somewhere?

here's part of code hide , show .chide (which in document.ready)

 $('.done').click(function(){             $('#n_keypad').hide();             login_code = $('#myinput').val();              $.post( '/login' , {passcode:login_code.tostring()})                 .done(function(reply) {                     $("#login_div").hide();                     alert("you login " + reply);                     if (reply=="engineer"){                          $("#securitymode").show();                          $("#labels").show();                          $("#status").show();                          $("#display").show();                                                       $("#logoutbutton").show();                          $(".chide").show();                          $("#loginbutton").hide();                          $("#configtable").hide();                     }                        else if(reply=="user"){                         $("#securitymode").show();                                                     $("#configtable").show();                         $("#logoutbutton").show();                         $("#labels").hide();                         $("#status").show();                         $("#display").hide();                         $("#configeditdiv").hide();                                                     $(".chide").hide();                       } 

jquery mobile has had problems hiding buttons, since framework wraps button in styled div , hides button (i.e. you're trying hide button that's hidden). problem has been addressed question: jquery mobile cannot hide submit button

which suggest $('.chide').closest('.ui-btn').hide(); should work you. give try , let me know if works :)


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -