Wednesday, June 13, 2012

Table header is not fixed with Jquery fixheadertable plugin

If you load the table result into a div like the following, where you try to fix the height with css with overflow, the header will not be fixed after scrolling

     <div id="divA21InvResult" style="height:300px;overflow:auto"></div>  



Instead you should add the option "height" when you call the fixheadertable function and pair with a simple div without any height declaration in css

       <div id="divA21InvResult"></div>  

        $('#tblA21InvPrint').fixheadertable({
                    caption     : '',
                    height      : '300',                   
                    colratio    : [30, 50, 100, 100, 50, 515, 80, 400, 400],                  
                    sortable    : true,
                    sortedColId : 1,
                    dateFormat  : 'd-M-Y',
                    resizeCol   : true, 
                    sortType    : ['string1','integer', 'date', 'string', 'string', 'string', 'float', 'string', 'string'],
                    textAlign   : ['center','right','center','center','center','left','right','left','left']
                });


Tuesday, June 12, 2012

Error Placement Issue with Jquery Validation Plugin










I encountered the above problem with jquery validation plugin where the error message spans into multiple lines, eventhough there is more than enough span after the input element.

To solve this problem, you may add in the following css

label.error{
    color:red;   
    width:auto; /*Add this line*/
}