Results 1 to 2 of 2
  1. #1

    Applying CSS to dynamically created checkbox in a dynagrid

    I have my dynagrid set up like this:

    HTML Code:
    <table cellpadding="2" id="grid2"> 
    <thead>
         <tr class="tabletitle">
          <th width="20%" nowrap id="col_stock_name"><input type="checkbox" style="float: left" id="apples_check">Currency
           </th>
            <th width="22%" nowrap id="col_spread">B/A Spread
            </th>
                  <th width="16%" nowrap id="col_ask">Sell
            </th>
               <th width="16%" nowrap id="col_bid">Buy
            </th>
    
    
          
         <th width="16%" nowrap id="col_count">Count
            </th>
         
     
         <th width="18%" nowrap id="col_time">Time
            </th>
        </tr>
          </thead>
     <tbody>
    
    
        <tr id="stocks"  data-source="lightstreamer"  border="0" >
          <td nowrap style="text-align: left">
    
    
             <input type="checkbox" style="float: left" id="apples_check">
              <div  id="stockName" data-source="lightstreamer" data-field="stock_name">Loading...</div>
            
          </td>
           <td style="padding:0px; margin-top:-10px; height:20px;" ><div style="width:100%; height:100%;" data-source="lightstreamer"  class="spreaddiv" data-field="spread">-</div></td>
            <td><div  data-source="lightstreamer" data-field="ask">-</div></td>
          <td><div  data-source="lightstreamer" data-field="bid">-</div></td>
          
         
         <td><div  data-source="lightstreamer" data-field="count">-</div></td>
          
       
         
           <td><div  data-source="lightstreamer" data-field="time">-</div></td>
      
         
        </tr>
        
    </tbody>
      </table>
    I am using JqueryUI to style my checkboxes, and it works on the one in the header, because it is not dynamically generated, but with the checkboxes in the "stocks" row, the checkboxes do not come out styled. Anyone have any tips? Is there a way to know at what precise moment lightstreamer finishes building the grid like some kind of trigger?

    Thanks in advance! Daniel

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    The DynaGrid does not have any event to signal that it is complete because it is actually never complete: at any time you can add a new row to the grid.

    I have two suggestions, let us know if you can solve your issue with these:
    • per each update the DynaGrid fires an onVisualUpdate event on its DynaGridListener. The first time the event is fired for a certain key corresponds to the moment a new row is entering the grid. The event is fired right before the new html is added to the page but the html that is going to be added is passed as a parameter to the callback. Would you be able to act there? See http://www.lightstreamer.com/docs/cl...onVisualUpdate
    • If you know beforehand how many rows your grid will have you may use a StaticGrid instead of using a DynaGrid. This way you'll statically prepare the html for the grid.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 03:50 PM.