Thursday, 17 April 2014

How to configure / install PHP Yii Framework on Netbeans

Configure / install  PHP Yii Framework on Netbeans:

Softwares Required:

1. Netbeans Latest Version - (https://netbeans.org/downloads/)
2. PHP Yii framework plugin for Netbeans - (http://plugins.netbeans.org/plugin/47246/php-yii-framework-netbeans-phpcc)
3.Yii Framework - (http://www.yiiframework.com/)

Configuration Steps:

Step 1: Download Netbeans latest version and install it.

Step 2: Install PHP Yii Framework plugin in netbeans.
            Open Netbeans and go to Tools -> Plugins -> and Click Download Tab.
            There you can find Add Plugins.. button and browse fo the Yii framework plugin that downloaded.
            Then select that plugin and click the Install button. It will install the Yii Framework in netbeans.

Step 3: Configure Yii framework on Netbeans.

            In Netbeans, go to Tools -> Options -> and Click PHP Tab.
            Inside PHP tab there is tab called Yii. If the Yii tab appears then that means we installed the PHP Yii framework correctly.

            Before that, download the Yii framework and extract the source file and name that folder into Yii and save that folder somewhere near to web root Directory. I have Installed the Xampp in the D:\xampp Directory.

            Now in Netbeans Yii tab you have to add Yii script. Browse for that yii framework you downloded and find the following file inside that framework Yii\framework\yiic.php.





            In PHP tab make sure you provide the PHP Interpreter by Go to General Tab inside PHP Tab and Browse for the php.exe file that is installed in the Xampp Directory D:\xampp\php\php.exe.





Step 4: Create New PHP Project on Yii Framework.

           Select File -> New Project -> and Choose PHP Application -> Name the Project -> Verify Configuration -> In PHP Framework Select Yii PHP Web Framework -> Finish and the Project created.



































Related Links:

How to Cofigure Xdebug in Netbeans for Debugging

Wednesday, 9 April 2014

Free Bootstrap Admin Templates

Free Bootstrap Admin Templates:

               The following bootstrap admin templates are the best free admin templates that I found when I try to create a new project with bootstrap template which is responsive design.

AdminLTE Dasboard and Control Panel Template

  • Responsive admin template 
  • Free & open source 
  • Built with Bootstrap 3 
  • Easy to customize























Download & details: http://almsaeedstudio.com/


Metis Bootstrap admin template






















TemplateVamp admin template

          TemplateVamp based on Twitter Bootstrap, TemplateVamp is a fully functional and customizable admin template that leverages the power and flexibility of HTML5 & CSS3. It can be used as a front-end toolkit for rapidly developing web applications that are lightweight, faster, and mobile-friendly; a great starting point.





SB Admin 2 : A Free Bootstrap Admin Theme


























Charisma – free, responsive, multiple skin admin template

             Charisma is a fully featured, free, premium quality, responsive, HTML5 admin template (or backend template) based on Bootstrap from Twitter, it comes with 9 different themes to suit your style and application type.




Premium Bootstrap Admin Templates:

         Wrap Bootstrap contains many admin templates which is more beautiful than these free templates for around $15 to $20. If you are ready for Premium template go for it.






Wednesday, 2 April 2014

Check if a checkbox is checked in CheckboxList with javascript

Check if a checkbox is checked in CheckboxList with javascript


Description:
                  Find if the checkbox in the Checkboxlist is checked and has the text none or n/a and perform functionality in javascript.

ASPX:

<asp:CheckBoxList runat="server" ID="chkList" TabIndex="21" onclick="chkList_click();">
</asp:CheckBoxList>

JAVASCRIPT:

function chkList_click() {        
     // Get CheckboxList element        
     var elementRef = document.getElementById("<%=chkList.ClientID%>");          
     // Get input element inside the CheckboxList         
     var checkBoxArray = elementRef.getElementsByTagName('input');        
     // Iterate throught the CheckboxList input tag array        
     for (var i = 0; i < checkBoxArray.length; i++) {            
           // Get every checkbox by loop            
           var listControl = checkBoxArray[i];            
           if (listControl.type == "checkbox") { // Check if Checkbox                
                  if (listControl.checked == true) { // if checked true                   
                         //find Checkbox text.                    
                         var labelArray = listControl.parentElement.getElementsByTagName('label');                    
                         if (labelArray[0].innerHTML.toLowerCase() == 'none' ||                                                                  labelArray[0].innerHTML.toLowerCase().indexOf('n/a')  > -1) {                        
                                 // Your code here                        
                                 //checked = true;                        
                                 //break;                    
                         }                
                   }            
            }        
      } 
}

Wednesday, 19 March 2014

Asp Gridview Render the header row as thead and tbody

Asp Gridview Render the header row as thead and tbody:

Description:

                When setting the property UseAccessibleHeader = true, it replaces the<td> elements of the header row with the correct <th> which means table header. It also adds the scope property of these header elements making them more accessible.

C# code:

      //This replaces <td> with <th> and adds the scope attribute
      gvtabledetails.UseAccessibleHeader = true;

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

      //This adds the <tfoot> element. Remove if you don't have a footer row 
      gvtabledetails.FooterRow.TableSection = TableRowSection.TableFooter;

Reference Link:

http://madskristensen.net/post/make-the-gridview-control-accessible




Capture Postback event Javascript ( Client side )

Capture Postback event Javascript:

Description:

        This piece of javascript code can intercept dopostback event in asp.net
        
        get the Dopostback event and call it after the AlwaysFireBeforeFormSubmit function. I used this code to show my overlay effect with progress bar and let the postback occurs.

Javascript:

<script type="text/javascript">
        var __oldDoPostBack = __doPostBack;
        __doPostBack = AlwaysFireBeforeFormSubmit;

        function AlwaysFireBeforeFormSubmit(eventTarget, eventArgument) {


            // Here we can add our function needed to execute before postback.


            return __oldDoPostBack(eventTarget, eventArgument);

        }
</script>

Relevant Post:

Overlay effect with jQuery and CSS

Overlay effect with jQuery and CSS

Overlay effect with jQuery:       

       1. This html code can be used as overlay effect when event postback occurs. 
       2. In this html code div with progress class used to show progress bar and the div with loading class used for displaying loading image or font inside the overlay effect. 
       3. Here I used font awesome icons.
       4. Switch the div style from display none to display block it will be shown as in the screen by applying jquery.

HTML:

    <div class="overlayidentifier overlay mouse-events-off" style="display: none">
        <div class="progress progress-mini ">
            <div style="width: 10%" class="pbidentifier progress-bar progress-bar-success">
            </div>
        </div>
        <div class="loading">
            <i class='icon-spinner icon-spin pink icon-5x'></i><i class='icon-blank icon-spin icon-5x'>
            </i>
        </div>
    </div>

CSS:
        /* Overlay effect for div */
        .overlay
        {
            background-color: rgba( 0, 0, 0, .2 );
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0; /* also -moz-opacity, etc. */
            z-index: 100000;
        }
        
        /* Progres bar styles */
        .overlay .progress
        {
            height: 3px !important;
            z-index: 100001;
        }

         /* loading image styles */

        .loading
        {
            text-align: center;
            height: 100%;
        }
        .loading i
        {
            top: 45% !important;
            position: absolute;
        }

jQuery:

$('.overlayidentifier').css('display', 'block');
$('.overlayidentifier').css('display', 'none');

------------------------------------------------------------------------------------------------------------