December 15 2013

Jquery highlight table row on click

Tagged Under :

jquery
To highlighter table row when user click the row. The easy way was add a css class on table “tr”.

How to add a css on “tr”? you need used JQuery to perform this action.

Before that, you need a table like below:
<div id="gridview">
  <table border="1" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>Row 1</td>        
    </tr>
    <tr>
      <td>Row 2</td>        
    </tr>
    <tr>
      <td>Row 3</td>            
    </tr>
    <tr>
      <td>Row 4</td>        
    </tr>
  </table>
</div>

And then add the “highlighted” css class as well
.highlighted {
    color: #261F1D
    background-color: #E5C37E;
}

January 20 2013

Jquery Array Key Search

Tagged Under : ,

jquery
How to using jQuery search the array key or check for a key exists in an array.

Since JavaScript doesn’t really have associative arrays, then we only write a function to check.

January 20 2013

Jquery Static Array

Tagged Under : ,

jquery
Use a short code to get a value from the database the easy way is using Ajax.

But the short code and value are fixed, we keep it in database is for future reuse it.

So I use another way to get the value. That is an array. use array key find the value.

January 16 2013

Jquery Remove White Spacing

Tagged Under : ,


Use jQuery remove white space to avoid user escape required field.

There is one of the functions from jQuery which help to solve this problem.

January 16 2013

Jquery Find Attribute Name Value of Input

Tagged Under : ,

jquery
Because want use jQuery get the input box value but the input box without the id attribute.

Then need use name attribute to find the input box get the value.

January 08 2013

Jquery Date Range Picker

Tagged Under : ,

jquery
Following last post Javascript Date Range Picker it was using pure javascript without using any framework.

Now we built another with JQuery.