PRN 5461 - Add Most Recent PRN to View/Edit/Task

To display the recent PRN list in the view/edit/task popup on enter record ID (PRN) or Title.

by asifmohammed

HTML

<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script>
<div class="body-content">
<div class="command-widget"> 
<div class="widget-header">▼
    <span class="command-widget-title-short">Commands</span>
</div>    
<div class="widget-content">    
<ul class="command-widget-list">    
<li id="command_widget_link1" class="command-widget-link">       <a title="View a Record" href="javascript:void(0);">View a Record</a>
    <br/>
    <span class="span-note">(normal popup)</span> 
</li>    
<li id="command_widget_link2" class="command-widget-link">       <a title="View a Record" href="javascript:void(0);">View a Record</a>
    <br/>
    <span class="span-note">(popup with truncated items)</span>
</li>    
</ul> 
</div>
</div>    
    
<div id="record_popup">
   <div id="record_popup_header" class="record-popup-header"> </div>
   <div id="record_popup_content" class="record-popup-content"></div>
</div>

</div>

CSS

.body-content {
    direction: ltr;
    font-family: Lucida Grande,Segoe UI,Arial,sans-serif;
    font-size: 0.9em !important;
    text-align: left;
}

.command-widget {
    background: none repeat scroll 0 0 #FEFEFE;
    border-radius: 5px 5px 5px 5px;
    -webkit-border-radius: 5px 5px 5px 5px;
    box-shadow: 0 6px 10px #888888;      width: 250px;
}

.widget-header {
    background: -moz-linear-gradient(top, #579ad5 0%, #27679f 50%, #1d4c76 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#579ad5), color-stop(50%,#27679f), color-stop(100%,#1d4c76)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #579ad5 0%,#27679f 50%,#1d4c76 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #579ad5 0%,#27679f 50%,#1d4c76 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #579ad5 0%,#27679f 50%,#1d4c76 100%); /* IE10+ */
background: linear-gradient(to bottom, #579ad5 0%,#27679f 50%,#1d4c76 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#579ad5', endColorstr='#1d4c76',GradientType=0 ); /* IE6-9 */
    border-radius: 5px 5px 0 0;
    -webkit-border-radius: 5px 5px 0 0;
    color: #FEFEFE;
    cursor: move;
    font-family: Lucida Grande,Segoe UI Semibold,Arial,sans-serif;
    font-weight: normal;
    min-height: 18px;
    padding: 6px;
}

.widget-content {
    border-radius: 0 0 5px 5px;
    margin: 0;
    padding-bottom: 1px;
    border: 1px #D3D3D3 solid;
}

.command-widget-title-short {
    overflow: hidden;
    padding: 0 0 0 5px;
    position: absolute;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 75%;
}

.command-widget-list {
    padding-left: 8px;    
}

.span-note {
    font-size: smaller;
    color: red;
}

.record-popup-header {
    padding: 4px 4px 10px 0;
}

.record-popup-text {
    font-family: Courier New !important;
    font-size: 20px !important;
    /*font-weight: bold;*/
    padding: 4px;
    width:...

JavaScript

$("#command_widget_link1 a").click(function() {

    var $popUp = $("#record_popup");
    $popUp.dialog({
        title: 'View Record',
        modal: true,
        resizable: false,
        autoResize: true,
        draggable: true,
        buttons: {
            'Go': function() {
                $(this).dialog('close');
            },
            'Close': function() {
                $(this).dialog('close');
            }
        },
        open: function(event) {
            $("#record_popup_header").html("Enter PRN of the desired record:");
            $("#record_popup_content").html("<input  id='prn_text' name='prn_text' value='' maxlength='100' />");

            var dataList = [{
                ID: "RC1234454545",
                Title: "RC1234454545 - Bug"},
            {
                ID: "RC1234567890",
                Title: "RC1234567890 - Enhancement"},
            {
                ID: "RC1467818293",
                Title: "RC1467818293 - Release 8.0 code freeze is June 31, 2011. Please contact Sue Smith ASAP with any potential schedule slips.Please contact Sue Smith ASAP with any potential sched"}];

            $("#prn_text").width(280).kendoComboBox({
                width: 100,
                autoBind: false,
                dataTextField: "Title",
                dataValueField: "ID",                
                dataSource: {
                    type: "json",
                    pageSize: 10,
                    data: dataList
                },
                filter: "contains",
                ignoreCase: false
            }).data("kendoComboBox").value("RC1234567890");
        },
        close: function(event) {

        }
    });
    $popUp.show().dialog('open');
});



$("#command_widget_link2 a").click(function() {

    var $popUp = $("#record_popup");
    $popUp.dialog({
        title: 'View Record',
        modal: true,
        resizable: false,
        autoResize: true,
        draggable: true,
        buttons: {
           ...