| <script src="JQuery/jquery-1.4.1.js" type="text/javascript"></script>
|
| 1:<script type="text/javascript" language="javascript" >
|
| 2: $(document).ready(function() {
|
| 3:
|
| 4: $(".divLeads .showPop").click(function(e) {
|
| 5: var currentObjId = (this.id);
|
| 6: _text = $("img#" + currentObjId).attr('CaseId');
|
| 7: var _rowIndex = $("img#" + currentObjId).attr('RowIndexId');
|
| 8:
|
| 9: // load data
|
| 10: LoadRowData(_rowIndex);
|
| 11: var posx = e.pageX - (this.offsetLeft - 10);
|
| 12: var posy = e.pageY - (this.offsetTop - 10);
|
| 13:
|
| 14: $('.divInLinePop').css({ left: posx, top: posy }).animate({ opacity: 'show' }, "slow");
|
| 15: return false;
|
| 16: });
|
| 17:
|
| 18:
|
| 19: $(".divCloseInLinePop").click(function() {
|
| 20: $('.divInLinePop').animate({ opacity: 'hide' }, "slow");
|
| 21: return false;
|
| 22: });
|
| 23:
|
| 24: });
|
| 25:
|
| 26:
|
| 27: function LoadRowData(RowIndex) {
|
| 28: var _rowindex = eval(eval(RowIndex) - 2);
|
| 29: $("#ctl00_ContentPlaceHolderFox_lblRowMessage").html("");
|
| 30: document.getElementById("ctl00_ContentPlaceHolderFox_hdnResetRowValues").innerText = _rowindex;
|
| 31:
|
| 32:
|
| 33: var grid = $find("ctl00_ContentPlaceHolderFox_rgdLeads");
|
| 34: var row = grid.get_masterTableView().get_dataItems()[_rowindex].get_element();
|
| 35:
|
| 36: document.getElementById("ctl00_ContentPlaceHolderFox_txtAmount").innerText = row.cells[8].innerText;
|
| 37: var currency = row.cells[9].innerText;
|
| 38: if (currency != "") {
|
| 39: SelectOption("ctl00_ContentPlaceHolderFox_ddlstCurrency", currency);
|
| 40:
|
| 41: }
|
| 42: var stages = row.cells[13].innerText;
|
| 43: if (stages != "") {
|
| 44: SelectOption("ctl00_ContentPlaceHolderFox_ddlstStages", stages);
|
| 45:
|
| 46: }
|
| 47:
|
| 48: var DurationUnit = row.cells[12].innerText;
|
| 49: if (DurationUnit != "") {
|
| 50: SelectOption("ctl00_ContentPlaceHolderFox_ddlstDurationUnit", DurationUnit);
|
| 51:
|
| 52: }
|
| 53:
|
| 54: $get("ctl00_ContentPlaceHolderFox_txtDuration").innerText = row.cells[11].innerText;
|
| 55: $get("ctl00_ContentPlaceHolderFox_txtNextStep").innerText = row.cells[15].innerText;
|
| 56:
|
| 57: // set readonly fields.
|
| 58: $("#divCaseCode").html(row.cells[2].innerText);
|
| 59: $("#divClientName").html(row.cells[4].innerText);
|
| 60:
|
| 61:
|
| 62: }
|
| 63:
|
| 64:
|
| 65: function SelectOption(ListObj, Text) {
|
| 66: var List = document.getElementById(ListObj);
|
| 67: for (i = 0; i < List.options.length; i++) {
|
| 68: if (Trim(List.options[i].text.toLowerCase()) == Trim(Text.toLowerCase())) {
|
| 69: // alert(List.options[i].text + Text);
|
| 70: List.selectedIndex = i;
|
| 71: break;
|
| 72: }
|
| 73: else {
|
| 74: List.selectedIndex = 0;
|
| 75: }
|
| 76:
|
| 77: }
|
| 78: }
|
| 79:
|
| 80:
|
| 81: function ResetRowValues(RowIndex) {
|
| 82: alert("Update Successful!");
|
| 83: var grid = $find("ctl00_ContentPlaceHolderFox_rgdLeads");
|
| 84: var row = grid.get_masterTableView().get_dataItems()[RowIndex].get_element();
|
| 85:
|
| 86: row.cells[8].innerText = document.getElementById("ctl00_ContentPlaceHolderFox_txtAmount").defaultValue;
|
| 87: row.cells[11].innerText = $get("ctl00_ContentPlaceHolderFox_txtDuration").defaultValue;
|
| 88: row.cells[15].innerText = $get("ctl00_ContentPlaceHolderFox_txtNextStep").defaultValue;
|
| 89:
|
| 90: //dropdowns
|
| 91: row.cells[9].innerText = $get("ctl00_ContentPlaceHolderFox_ddlstCurrency").options[$get("ctl00_ContentPlaceHolderFox_ddlstCurrency").selectedIndex].text;
|
| 92: row.cells[13].innerText = $get("ctl00_ContentPlaceHolderFox_ddlstStages").options[$get("ctl00_ContentPlaceHolderFox_ddlstStages").selectedIndex].text; ;
|
| 93: row.cells[12].innerText = $get("ctl00_ContentPlaceHolderFox_ddlstDurationUnit").options[$get("ctl00_ContentPlaceHolderFox_ddlstDurationUnit").selectedIndex].text;
|
| 94:
|
| 95:
|
| 96:
|
| 97: //finally hide the in-line div.
|
| 98: $('.divInLinePop').animate({ opacity: 'hide' }, "slow");
|
| 99:
|
| 100: }
|
| 101:
|
| 102:</script>
|
| 103: |