Wednesday, May 28, 2014

JQuery DataTable Column Filter

This works well for Gridview

References include in the page
<script src="/_layouts/XX.XX.UI/js/jquery.dataTables.min.js" type="text/javascript"></script>
<link href="/_layouts/XX.XX.UI/css/datatable_css.css" rel="stylesheet" type="text/css" />

Script include in the page
<script type="text/javascript">
    function pageLoad() {
        $('#<%=gvNews.ClientID%>').dataTable({
            "bSort": false,
            "bPaginate": true,
            "sPaginationType": "full_numbers"
        });
    }
 </script>

Gridview prerender needs to be include
protected void gvNews_PreRender(object sender, EventArgs e)
        {
            try
            {
                if (gvNews.Rows.Count > 0)
                {
                    //This replaces <td> with <th> and adds the scope attribute
                    gvNews.UseAccessibleHeader = true;

                    //This will add the <thead> and <tbody> elements
                    gvNews.HeaderRow.TableSection = TableRowSection.TableHeader;

                    //This adds the <tfoot> element.
                    //Remove if you don't have a footer row
                    gvNews.FooterRow.TableSection = TableRowSection.TableFooter;
                }
            }
            catch (Exception ex)
            {
                Logger.LogEntry("News webpart, gvNews_PreRender method : " + ex.Message);
            }
        }



Reference:
http://jquery-datatables-column-filter.googlecode.com/svn/trunk/default.html


Mount and Dismount

Some times we need to attach detached database for webapplication

step1: Dismount the existing database for webapplication
Dismount-SPContentDatabase "RestoreDB_WSS_Content_Intranet"

step2: Mount the required database
Mount-SPContentDatabase “RestoreDB_WSS_Content_Intranet” -DatabaseServer "SharePointStagDB" -WebApplication http://Server01:46154/ -AssignNewDatabaseId

step3: Test any errors occured
Test-SPContentDatabase -Identity "RestoreDB_WSS_Content_Intranet"

step4: make it online to use that webapplication
Set-SPContentDatabase -Identity "RestoreDB_WSS_Content_Intranet" -Status OnLine

Image noise comparison methods

 1. using reference image technique     - peak_signal_noise_ratio (PSNR)     - SSI 2. non-reference image technique     - BRISQUE python pac...