DNK Gif

Dot Net Knowledge

Labels

Tuesday, 25 August 2015

SQL Paging

SQL Paging Select Query


SELECT *
  FROM (SELECT *
          FROM ( SELECT ROWNUM SNO
                      , RESULT.*
                   FROM (
SELECT DISTINCT PSD.PSD_SUMMARYID   PMD_SUMMARYID,
                                                  TO_CHAR(PSD.PSD_CREATEDTIME, :dateFormat) PSD_CREATEDTIME,
                                                  PSD.PSD_CREATEDTIME CREATEDTIME,
                                                  INS.INS_NAME  INSURERNAME                                             
                                               
                                    FROM [SCHEMA].PLC_PSD_PAYMENTSUMMARYDETAILS PSD
                                                INNER JOIN [SCHEMA].PLC_PMD_PAYMENTDETAILS PMD
                                                ON PSD.PSD_SUMMARYID = PMD.PMD_SUMMARYID
                                                INNER JOIN [SCHEMA].PLC_PLC_POLICY PLC
                                                ON PMD.PMD_POLICYID = PLC.PLC_POLICYID
                                                INNER JOIN [SCHEMA].MST_INS_INSURERMASTER INS
                                                ON INS.INS_INSURERID              = PSD.PSD_INSURERID
                                                WHERE PLC.PLC_APPLICATIONCLIENTKEY = :APPLICATIONCLIENTKEY
                                                AND PLC.PLC_DEALERID               = :PLC_DEALERID
                                                AND PMD.PMD_SUMMARYID IS NOT NULL
                                     order by PMD_SUMMARYID desc
) RESULT
                  WHERE ROWNUM <=(:Page_No*10) ORDER BY ROWNUM DESC )
         WHERE ROWNUM <=10 ORDER BY ROWNUM DESC
       )
 ORDER BY SNO

Thursday, 6 August 2015

pointer-events:none Chrome, IE, FireFox solved

pointer-events:none property for Chrome, IE & Firefox

This property work fine in Chrome & Firefox.
 
Alternative for Internet Explorer is given below
 
$(document).on('mousedown', '.TopElement', function (e) {
            $(this).hide();
            var BottomElement = document.elementFromPoint(e.clientX, e.clientY);
            $(this).show();
            $(BottomElement).mousedown(); //Manually fire the event for desired underlying element
            return false;
        });

Example:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p").click(function(){
        $(this).hide();
    });
});
$(document).on('mousedown', '#divPointer', function (e) {
            $(this).hide();
            var BottomElement = document.elementFromPoint(e.clientX, e.clientY);
            $(this).show();
            $(BottomElement).mousedown(); //Manually fire the event for desired underlying element
            return false;
        });
</script>
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
<div id="divPointer">
<input type="text" value="umesh" style="pointer-events:none"></input></div>
</body>
</html>

Wednesday, 5 August 2015

Track changes in a HTML form (DOM onchange Event handler)

How to track changes made in a HTML form?

Description: Bind an event handler to the "change" JavaScript event, or trigger that event on an element.

This method is a shortcut for .on( "change", handler ) in the first two variations, and .trigger( "change" ) in the third.
The change event is sent to an element when its value changes. This event is limited to <input> elements, <textarea>boxes and <select> elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.
For example, consider the HTML:
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>change demo</title>
  <style>
  div {
    color: red;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 <form>
<select name="sweets" multiple="multiple">
  <option>Chocolate</option>
  <option selected="selected">Candy</option>
  <option>Taffy</option>
  <option selected="selected">Caramel</option>
  <option>Fudge</option>
  <option>Cookie</option>
</select>
<div></div>
<div id="divChange"></div>
<input id="tb" type="text" value="umesh"></input>
  </form>
<script>
$( "form" )
  .change(function () {

    var str = "";
    $( "select option:selected" ).each(function() {
      str += $( this ).text() + " ";
    });
    $( "div" ).text( str );
$("#divChange").text($("#tb").val());
  })
  .change();
</script>
 
</body>
</html>

For more information: