geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tush...@apache.org
Subject [04/79] [partial] incubator-geode git commit: GEODE-12: Imported pulse from geode-1.0.0-SNAPSHOT-2.src.tar
Date Tue, 03 Nov 2015 11:25:26 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQuery.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQuery.js b/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQuery.js
new file mode 100644
index 0000000..d463edd
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQuery.js
@@ -0,0 +1,953 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+// DataBrowserQuery.js
+
+var responseResult = null;
+
+// This function activates Execute button
+function enableExecuteBtn(flagEnable) {
+  if (flagEnable) {
+    $('#btnExecuteQuery').prop("disabled", false);
+    if ($('#btnExecuteQuery').hasClass("grey")) {
+      $('#btnExecuteQuery').addClass("blue");
+      $('#btnExecuteQuery').removeClass("grey");
+    }
+  } else {
+    $('#btnExecuteQuery').prop("disabled", true);
+    if ($('#btnExecuteQuery').hasClass("blue")) {
+      $('#btnExecuteQuery').addClass("grey");
+      $('#btnExecuteQuery').removeClass("blue");
+    }
+  }
+}
+
+// This function is called when query editor content changes
+function onQueryTextChange() {
+  var queryString = $('#dataBrowserQueryText').val();
+  if (!isEmpty(queryString)) {
+    enableExecuteBtn(true);
+  } else {
+    enableExecuteBtn(false);
+  }
+}
+
+// This function clears query editor 
+function clearDBQuery(){
+  $('#dataBrowserQueryText').val('');
+  onQueryTextChange();
+}
+
+// This function executes query written in query editor and displays results
+function executeDBQuery(){
+  // Disable Execute button
+  enableExecuteBtn(false);
+
+  var queryText = $('#dataBrowserQueryText').val();
+  var selectedMemberNames = "";
+  
+  if(isEmpty(queryText)){
+    alert("Please enter query to execute..");
+    return;
+  }
+  
+  // Determine selected members query to be execute on 
+  if($("#membersList").html() != ""){
+    var selectedMembers = $( "input[type=checkbox][name=Member]:checked" );
+    for(var i=0; i< selectedMembers.length; i++){
+      if(selectedMemberNames == ""){
+        selectedMemberNames = selectedMembers[i].value;
+      }else{
+        selectedMemberNames += ","+selectedMembers[i].value;
+      }
+    }
+  }
+  
+  // TODO 
+  // As of now, member names are creating problem due to ':' character in 
+  // member names. hence query based upon member names are not supported.
+  // following line of code should be removed when solution to this problem is 
+  // in place.
+  //selectedMemberNames = "";
+  
+  requestData = {
+        query:queryText,
+        members:selectedMemberNames,
+        limit:0
+      };
+
+  // Display Loading/Busy symbol
+  $("#loadingSymbol").show();
+
+  // Delete previous query result, if exists.
+  if(!isEmpty($('#memberAccordion').html())){
+    deleteExistingResultGrids();
+    $('#memberAccordion').html('');
+  }
+
+  $.getJSON("pulse/dataBrowserQuery", requestData, function(data) {
+    
+    if(data != undefined && data != null){
+      if(data.error != undefined && data.error != null){
+        
+        // Delete previous query result, if exists.
+        /*if(!isEmpty($('#memberAccordion').html())){
+          deleteExistingResultGrids();
+          $('#memberAccordion').html('');
+        }*/
+        
+        var errorText = data.error;
+        errorText = encodeMemberName(errorText);
+        
+        $('#memberAccordion').append("<span>"+errorText+"</span>");
+
+      }else if(data.message != undefined && data.message != null){
+
+        // Delete previous query result, if exists.
+        /*if(!isEmpty($('#memberAccordion').html())){
+          deleteExistingResultGrids();
+          $('#memberAccordion').html('');
+        }*/
+
+        var messageText = data.message;
+        messageText = encodeMemberName(messageText);
+
+        $('#memberAccordion').append("<span>"+messageText+"</span>");
+
+      }else{
+        //console.log("data.result.length"+data.result.length);
+        // Convert received data into expected format
+        responseResult = convertRawResponseToExpectedFormat(data);
+        
+        // Delete previous query result, if exists.
+        /*if(!isEmpty($('#memberAccordion').html())){
+          deleteExistingResultGrids();
+          $('#memberAccordion').html('');
+        }*/
+        
+        // Create html for newly executed query
+        createHtmlForQueryResults();
+        
+        // Apply accordion Behavior 
+        accordion();
+        accordionNested();
+        /*custom scroll bar*/
+        $('.ScrollPaneBlock').jScrollPane();
+        
+        // Populate result grids
+        if(!isEmpty($('#memberAccordion').html())){
+          populateResultGrids();
+        }
+        // Update queries list in history panel
+        updateQueryHistory("view","");
+        //$('.queryHistoryScroll-pane').jScrollPane();/*Custome scroll*/
+        
+      }
+    }
+    
+    // Hide Loading/Busy symbol
+    $("#loadingSymbol").hide();
+
+    // enable Execute button
+    enableExecuteBtn(true);
+
+  }).error(resErrHandler);
+  
+  return;
+}
+
+// This function displays error if occurred 
+function resErrHandler(data){
+  // Check for unauthorized access
+  if (data.status == 401) {
+    // redirect user on Login Page
+    window.location.href = "Login.html?error=UNAUTH_ACCESS";
+  }else{
+    console.log(data);
+  }
+};
+
+// This function creates complete result panel html
+function createHtmlForQueryResults(){
+  var memberResults = responseResult.result;
+
+  if(memberResults.length > 0){
+
+    if(memberResults[0].member != undefined || memberResults[0].member != null){
+      //console.log("member wise results found..");      
+      for(var i=0; i<memberResults.length; i++){
+        //console.log(memberResults[i].member);
+        $('#memberAccordion').append(createHtmlForMember(memberResults[i]));
+      }
+    }else{
+      //console.log("cluster level results found..");
+      var accordionContentHtml = "";
+      accordionContentHtml = createClusterAccordionContentHtml(memberResults);
+      var resultHtml = "<div class=\"accordion-content2\">"+ accordionContentHtml +"</div>";
+      $('#memberAccordion').append(resultHtml);
+    }
+  }else{
+    $('#memberAccordion').append("<span> No Results Found...</span>");
+  }
+}
+
+// This function create/generate single member's html
+function createHtmlForMember(memberData){
+  
+  var accordionContentHtml = "";
+  accordionContentHtml = createMemberAccordionContentHtml(memberData);
+  // Convert angular brackets ('<', '>') using HTML character codes 
+  var memberTitle = memberData.member[1].replace(/\<+/g, '&#60').replace(/\>+/g, '&#62');
+  var memberHtml = 
+            "<div class=\"listing\">" +
+              "<div class=\"heading\">" +
+                "<span class=\"title\">"+ memberTitle + "</span>" +
+              "</div>" +
+              "<div class=\"accordion-content\">"+ accordionContentHtml +
+              "</div>" +
+            "</div>";
+  
+  return memberHtml;
+}
+
+// This function creates/generates member's accordion content html
+function createMemberAccordionContentHtml(memberData){
+  
+  var memName = encodeMemberName(memberData.member[1]);
+  var requiredHeight = determineAccordionContentHeight(memberData.result);
+  var memberAccordionContentHtml = "";
+  memberAccordionContentHtml += 
+                "<div class=\"ScrollPaneBlock\" style=\"height: "+requiredHeight+"px;\">" +
+                  "<div id=\"memberDetails_"+memName+"\" class=\"accordionNested\">";
+  
+  var memberResults = memberData.result;
+  for(var i=0; i<memberResults.length; i++){
+    var htmlTableId = generateTableIdForObjectsTable(memberData.member[1], memberResults[i].objectType);
+    var ScrollPaneBlockHeight = 40;
+    var resultsLength = memberResults[i].objectResults.length;
+    if(resultsLength > 0 && resultsLength < 6){
+      ScrollPaneBlockHeight += resultsLength * 30;
+    }else{
+      ScrollPaneBlockHeight = 200;
+    }
+    memberAccordionContentHtml += 
+                    "<div class=\"n-listing\">" +
+                      "<div class=\"n-heading\">" +
+                        "<span class=\"n-title\">"+memberResults[i].objectType+"</span>" +
+                      "</div>" +
+                      "<div class=\"n-accordion-content\">" +
+                        "<div class=\"widthfull-100per\">" +
+                            "<table id=\""+ htmlTableId +"\"></table>" +
+                        "</div>" +
+                      "</div>" +
+                    "</div>";
+  }
+  
+  memberAccordionContentHtml += 
+                  "</div>" +
+                "</div>";
+  
+  return memberAccordionContentHtml ;
+  
+}
+
+//This function creates/generates cluster's accordion content html
+function createClusterAccordionContentHtml(clusterResults){
+  var requiredHeight = determineAccordionContentHeight(clusterResults);
+  var memberAccordionContentHtml = "";
+  memberAccordionContentHtml += 
+             "<div class=\"ScrollPaneBlock\" style=\"height: "+requiredHeight+"px;\">" +
+               "<div id=\"clusterDetails\" class=\"accordionNested\">";
+
+  for(var i=0; i<clusterResults.length; i++){
+    var htmlTableId = generateTableIdForObjectsTable("", clusterResults[i].objectType);
+    var ScrollPaneBlockHeight = 40;
+    var resultsLength = clusterResults[i].objectResults.length;
+    if(resultsLength > 0 && resultsLength < 6){
+      ScrollPaneBlockHeight += resultsLength * 30;
+    }else{
+      ScrollPaneBlockHeight = 200;
+    }
+    memberAccordionContentHtml += 
+                 "<div class=\"n-listing\">" +
+                   "<div class=\"n-heading\">" +
+                     "<span class=\"n-title\">"+clusterResults[i].objectType+"</span>" +
+                   "</div>" +
+                   "<div class=\"n-accordion-content\">" +
+                     "<div class=\"widthfull-100per\">" +
+                         "<table id=\""+ htmlTableId +"\"></table>" +
+                     "</div>" +
+                   "</div>" +
+                 "</div>";
+  }
+
+  memberAccordionContentHtml += 
+               "</div>" +
+             "</div>";
+
+  return memberAccordionContentHtml ;
+
+}
+
+// Function to find/determine the required height of accordion container
+function determineAccordionContentHeight(result){
+  var numObjects = result.length;
+  // determine height of single grid/table
+  var height = 0;
+  for(var i=0; i<numObjects; i++){
+    var numObjectEntries = result[i].objectResults.length;
+    if(numObjectEntries > 0 
+        && numObjectEntries < 6){
+      if(height < 210){
+        height = 60 + numObjectEntries * 30;
+      }
+    }else{
+      height = 210;
+    }
+  }
+
+  // Add additional height required for accordin headers
+  height += numObjects * 30;
+  return height;
+
+}
+
+// Function to generates id of html table in which results grid is contained
+function generateTableIdForObjectsTable(memberName, objectName){
+  // Remove all dots (.) in the string and also replace "[]" by "BxBr"
+  var objName = objectName.replace(/\.+/g, '').replace("[]", 'BxBr');
+  var memName = encodeMemberName(memberName);
+  // form html table id
+  var tableId = "table-"+memName+"-"+objName;
+  
+  return tableId;
+}
+
+// Function to generates encoded member name
+function encodeMemberName(memberName){
+  var memName = memberName.replace(/\.+/g, '');
+  memName = memName.replace(/\(+/g, '-');
+  memName = memName.replace(/\)+/g, '-');
+  memName = memName.replace(/\<+/g, '-');
+  memName = memName.replace(/\>+/g, '-');
+  memName = memName.replace(/\:+/g, '-');
+  
+  return memName;
+}
+
+// This function populates query results into jqgrid tables 
+function populateResultGrids(){
+  
+  var memberResults = responseResult.result;
+
+  if(memberResults.length == 0){
+    return;
+  }
+
+  if(memberResults[0].member != undefined || memberResults[0].member != null){
+    for(var i=0; i<memberResults.length; i++){
+      
+      var memberResult = memberResults[i].result;
+      var memberName = memberResults[i].member[1];
+      for(var j=0; j<memberResult.length; j++){
+        var htmlTableId = generateTableIdForObjectsTable(memberName, memberResult[j].objectType);
+        
+        if($('#'+htmlTableId)){
+          createResultGrid(memberName, memberResult[j]);
+        }else{
+          console.log("Not Found : "+htmlTableId);
+        }
+      }
+    }
+  }else{
+      
+      var memberResult = memberResults;
+      var memberName = "";
+      for(var j=0; j<memberResult.length; j++){
+        var htmlTableId = generateTableIdForObjectsTable(memberName, memberResult[j].objectType);
+        
+        if($('#'+htmlTableId)){
+          createResultGrid(memberName, memberResult[j]);
+        }else{
+          console.log("Not Found : "+htmlTableId);
+        }
+      }
+  }
+}
+
+// Function to delete previous queries results from UI
+function deleteExistingResultGrids(){
+  if(responseResult == undefined || responseResult == null){
+    return;
+  }
+  
+  var memberResults = responseResult.result;
+
+  if(memberResults.length == 0){
+    return;
+  }
+
+  if(memberResults[0].member != undefined || memberResults[0].member != null){
+    for(var i=0; i<memberResults.length; i++){
+      
+      var memberResult = memberResults[i].result;
+      var memberName = memberResults[i].member[1];
+      for(var j=0; j<memberResult.length; j++){
+        var htmlTableId = generateTableIdForObjectsTable(memberName, memberResult[j].objectType);
+        
+        if($('#'+htmlTableId)){
+          $('#'+htmlTableId).jqGrid('GridDestroy');
+        }else{
+          console.log("Not Found : "+htmlTableId);
+        }
+      }
+    }
+  }else{
+    var memberResult = memberResults;
+    var memberName = "";
+    for(var j=0; j<memberResult.length; j++){
+      var htmlTableId = generateTableIdForObjectsTable(memberName, memberResult[j].objectType);
+      
+      if($('#'+htmlTableId)){
+        $('#'+htmlTableId).jqGrid('GridDestroy');
+      }else{
+        console.log("Not Found : "+htmlTableId);
+      }
+    }
+  }
+}
+
+// Function to create single results grid
+function createResultGrid(member, memberResultObject){
+  var objectType = memberResultObject.objectType;
+  // make a copy of memberResultObject.objectResults
+  var objectResults = jQuery.extend(true, [], memberResultObject.objectResults);
+  var htmlTableId = generateTableIdForObjectsTable(member, objectType);
+  
+  // TODO Following code section should be removed once to string representation 
+  // is finalized in same scenario 
+  // If results set is java primitive collection of HashMap then following 
+  // custom representation is needed
+  /*var customObjectResults = new Array();
+  if(objectType.indexOf("java.util.HashMap") != -1){
+    // generate customized objectResults
+    for(var cnt=0; cnt<objectResults.length; cnt++){
+      var uid = objectResults[cnt].uid;
+      delete objectResults[cnt].uid;
+      var newEntry = {"uid":uid, "result":["java.util.HashMap",objectResults[cnt]]};
+      customObjectResults.push(newEntry);
+    }
+    // replace existing objectResults by new customObjectResults
+    objectResults = customObjectResults;
+  }*/
+  
+  // Determine table columns
+  var columnName = new Array();
+  var columnModel = new Array();
+  for(var cnt=0; cnt<objectResults.length; cnt++){
+    for(key in objectResults[cnt]){
+      if(-1 == columnName.indexOf(key)){
+        // add column and column model only if not present
+        columnName.push(key);
+        columnModel.push({name:key, index:key, width:150});
+      }
+    }
+  }
+  
+  // set custom column widths if less columns
+  if(columnModel.length == 2){
+    for(var c=0; c<columnModel.length; c++){
+      columnModel[c].width = 660;
+    }
+  }else if(columnModel.length == 3){
+    for(var c=0; c<columnModel.length; c++){
+      columnModel[c].width = 330;
+    }
+  }else if(columnModel.length == 4){
+    for(var c=0; c<columnModel.length; c++){
+      columnModel[c].width = 220;
+    }
+  }
+  
+  // Delete jqgrid if already exists
+  $("#"+htmlTableId).jqGrid('GridDestroy');
+  
+  // Determine Grid's Height
+  var gridheight = 30;
+  if(objectResults.length > 0 && objectResults.length < 6){
+    gridheight += objectResults.length * 26;
+  }else{
+    gridheight = 160;
+  }
+  
+  // Create jqgrid 
+  jQuery("#"+htmlTableId).jqGrid({
+                  datatype: "local",
+                  width : 668,
+                  height: gridheight,
+                  shrinkToFit : false,
+                  colNames:columnName,
+                  colModel:columnModel,
+                  ondblClickRow:displayPopUpObjectExplorer,
+                  gridComplete : function() {
+                    $(".jqgrow").css({
+                      cursor : 'default'
+                    });
+
+                    var gridList = $('#gview_'+htmlTableId);
+                    var gridListChild = gridList.children('.ui-jqgrid-bdiv');
+
+                    gridListChild.unbind('jsp-scroll-x');
+                    gridListChild.bind('jsp-scroll-x', function(event,
+                        scrollPositionX, isAtLeft, isAtRight) {
+                      var mRList = $('#gview_'+htmlTableId);
+                      var mRLC = mRList.children('.ui-jqgrid-hdiv').children(
+                          '.ui-jqgrid-hbox');
+                      mRLC.css("position", "relative");
+                      mRLC.css('right', scrollPositionX);
+                    });
+                  },
+                  resizeStop : function(width, index) {
+
+                    var gridList = $('#gview_'+htmlTableId);
+                    var gridListChild = gridList.children('.ui-jqgrid-bdiv');
+                    var api = gridListChild.data('jsp');
+                    api.reinitialise();
+
+                    gridList = $('#gview_'+htmlTableId);
+                    gridListChild = gridList.children('.ui-jqgrid-bdiv');
+                    gridListChild.unbind('jsp-scroll-x');
+                    gridListChild.bind('jsp-scroll-x', function(event,
+                        scrollPositionX, isAtLeft, isAtRight) {
+                      var mRList = $('#gview_'+htmlTableId);
+                      var mRLC = mRList.children('.ui-jqgrid-hdiv').children(
+                          '.ui-jqgrid-hbox');
+                      mRLC.css("position", "relative");
+                      mRLC.css('right', scrollPositionX);
+                    });
+                  }
+          });
+  
+  // Hide "uid" column as it contains program generated unique id of row
+  $("#"+htmlTableId).jqGrid('hideCol',columnName[columnName.indexOf("uid")]);
+  
+  // Remove type details from values
+  for(var i=0; i<objectResults.length; i++){
+    for(key in objectResults[i]){
+      var arrVals = objectResults[i][key];
+      if(arrVals != null && arrVals != undefined){
+        if($.isArray(arrVals)){
+          if(arrVals.length == 2){
+            if(typeof (arrVals[1]) == "object"){ // if object, display its type as value
+              objectResults[i][key] = arrVals[0];
+            }else{ // else display its value
+              objectResults[i][key] = arrVals[1];
+            }
+          }else{ // if ArrayList object, display its type as value
+            objectResults[i][key] = arrVals[0];
+          }
+        }
+      } 
+    }
+  }
+
+  // Clear grid before populating rows into it
+  $("#"+htmlTableId).jqGrid('clearGridData');
+  $("#"+htmlTableId).jqGrid('addRowData',columnName[columnName.indexOf("uid")],objectResults);
+}
+
+// Function that displays object explorer in pop up
+function displayPopUpObjectExplorer(rowId, rowIndex, columnIndex, event){
+  //console.log("Row clicked: "+rowId+" "+rowIndex+" "+columnIndex+" "+event);
+  
+  var rowIdSplits = rowId.split('*');
+  var selMember = null
+  var selMemObject = null;
+  var selMemObjectRow = null;
+  var selectedRowData = null;
+  
+  if(rowIdSplits.length == 2){
+    selMemObject = rowIdSplits[0];
+    selMemObjectRow = rowIdSplits[1];
+  }else if(rowIdSplits.length == 3){
+    selMember = rowIdSplits[0];
+    selMemObject = rowIdSplits[1];
+    selMemObjectRow = rowIdSplits[2];
+  }else{
+    console.log("Incomplete inputs ");
+    return;
+  }
+  
+  var resResults = responseResult.result;
+  var memberResults = null;
+  var memberObjectResults = null;
+  
+  if(rowIdSplits.length == 2){
+    memberResults = resResults;
+  }else if(rowIdSplits.length == 3){
+    for(var i=0; i< resResults.length; i++){
+      if(resResults[i].member[1] == selMember){
+        memberResults = resResults[i].result;
+        break;
+      }
+    }
+  }
+  
+  for(var i=0; i< memberResults.length; i++){
+    // replace "[]" by "BxBr"
+    var objType = memberResults[i].objectType.replace("[]", 'BxBr');
+    if(objType == selMemObject){
+      memberObjectResults = memberResults[i].objectResults;
+      break;
+    }
+  }
+  
+  for(var i=0; i< memberObjectResults.length; i++){
+    /*if(memberObjectResults[i].ID[1] == selMemObjectRow){
+      selectedRowData = memberObjectResults[i];
+      break;
+    }*/
+    if(memberObjectResults[i].uid == rowId){
+      selectedRowData = memberObjectResults[i];
+      break;
+    }
+  }
+  
+  var popUpData = formDataForPopUpGrid(selectedRowData);
+  
+  // clear pop grid data
+  gridElement.jqGrid('clearGridData');
+  // add pop grid new data
+  gridElement[0].addJSONData({
+    total : 1,
+    page : 1,
+    records : popUpData.length,
+    rows : popUpData
+  });
+  
+  // Display pop up grid
+  $('#gridPopup').show();
+  $('.ui-jqgrid-bdiv').jScrollPane();
+
+  // Attaching handler to each row in object explorer to update vertical
+  // scrollbar when user expands/collapse tree grid row
+  $('div.tree-plus').click(function() {
+    $('.ui-jqgrid-bdiv').jScrollPane();
+  });
+                  
+  // Get the screen height and width
+  var maskHeight = $(document).height();
+  var maskWidth = $(window).width();
+
+  //Set heigth and width to mask to fill up the whole screen
+  $('#mask').css({'width':maskWidth,'height':maskHeight});
+  
+  //transition effect             
+  $('#mask').fadeIn(1000);        
+  $('#mask').fadeTo("fast",0.8);  
+
+  //Get the window height and width
+  var winH = $(window).height();
+  var winW = $(window).width();
+
+  //Set the popup window to center
+  $('#gridPopup').css('top',  winH/2-$('#gridPopup').height()/2);
+  $('#gridPopup').css('left', winW/2-$('#gridPopup').width()/2);
+
+}
+
+// Creates pop grid
+function createPopUpObjectExplorer(){
+  gridElement = $("#popUpExplorer");
+  gridElement.jqGrid({
+      datatype: "local",
+      colNames:["Id","Key","Value","Type"],
+      colModel:[
+          {name:'id', index:'id', width:1, hidden:true, key:true},
+          {name:'key', index:'key', width:220},
+          {name:'value', index:'value', width:220},
+          {name:'type', index:'type', width:230}
+      ],
+      cmTemplate: {sortable:false},
+      height: '220',
+      gridview: true,
+      rowNum: 10000,
+      sortname: 'id',
+      treeGrid: true,
+      treeGridModel: 'adjacency',
+      treedatatype: "local",
+      ExpandColumn: 'key',
+  });
+  
+  gridElement.jqGrid('clearGridData');
+  
+}
+
+// Function to prepare data for pop up object explorer
+function formDataForPopUpGrid(data){
+  
+  var newArray = [];
+  var idCounter = 1;
+
+  function traverse(object, level, parentId) {
+      for (var prop in object) {
+          if (typeof(object[prop]) == "object") {
+            if($.isArray(object[prop])){
+              
+              var arrObj = object[prop];
+              if(arrObj.length == 2){
+                
+                if (typeof(arrObj[1]) == "object") {
+                  //newArray.push({'key':prop, 'value':arrObj[1], 'type':arrObj[0]});
+                  newArray.push({
+                    'id':idCounter++,
+                    'key':prop, 
+                    'type':arrObj[0],
+                    'value':"", // ignore value for composite data
+                    'level':level,
+                    'parent':parentId,
+                    'isLeaf':false,
+                    'expanded':false,
+                    'loaded':true
+                    });
+                
+                  //going on step down in the object tree!!
+                  traverse(arrObj[1], level+1, idCounter-1);
+                }else{
+                  //newArray.push({'key':prop, 'value':arrObj[1], 'type':arrObj[0]});
+                  newArray.push({
+                    'id':idCounter++,
+                    'key':prop, 
+                    'type':arrObj[0],
+                    'value':arrObj[1],
+                    'level':level,
+                    'parent':parentId,
+                    'isLeaf':false,
+                    'expanded':false,
+                    'loaded':true
+                    });
+                }
+              }else{
+                //newArray.push({'key':prop, 'value':object[prop], 'type':typeof(object[prop])});
+                newArray.push({
+                  'id':idCounter++,
+                  'key':prop, 
+                  'type':typeof(object[prop]),
+                  'value':object[prop],
+                  'level':level,
+                  'parent':parentId,
+                  'isLeaf':false,
+                  'expanded':false,
+                  'loaded':true
+                  });
+                
+                // todo : multiple value traversing in array
+              }
+            }else{
+              newArray.push({
+                'id':idCounter++,
+                'key':prop, 
+                'type':"object",
+                'value':"", // ignore value for composite data
+                'level':level,
+                'parent':parentId,
+                'isLeaf':false,
+                'expanded':false,
+                'loaded':true
+                });
+              //going on step down in the object tree!!
+              traverse(object[prop], level+1, idCounter-1);
+            }
+              
+          }else{
+            //console.log(prop + " : "+object[prop]);
+            if(prop != "uid"){
+              newArray.push({
+                  'id':idCounter++,
+                  'key':prop, 
+                  'type':typeof(object[prop]),
+                  'value':object[prop],
+                  'level':level,
+                  'parent':parentId,
+                  'isLeaf':false,
+                  'expanded':false,
+                  'loaded':true
+                  });
+            }
+          }
+      }
+  }
+
+  // start traversing into data object 
+  traverse(data, 0, 0);
+  
+  return newArray;
+}
+
+//Function for converting raw response into expected format
+function convertRawResponseToExpectedFormat(rawResponeData){
+  
+  if(rawResponeData == null || rawResponeData == undefined){
+    return;
+  }
+  
+  var finalResponseData = {};
+  var finalResponseResults = new Array();
+  
+  if(rawResponeData.result != null || rawResponeData.result != undefined){
+    var rawResponeDataResult = rawResponeData.result;
+    
+    for(var i=0; i<rawResponeDataResult.length; i++){
+      if(rawResponeDataResult[i] != null){
+        if(typeof(rawResponeDataResult[i]) == "object"){
+          if($.isArray(rawResponeDataResult[i])){
+            // Cluster level result set
+            finalResponseResults = convertToExpectedObjectsFormat(rawResponeDataResult, "");
+            break;
+            
+          }else if(rawResponeDataResult[i].member != null && rawResponeDataResult[i].member != undefined){
+            
+            var responseForMember = {};
+            responseForMember.member = rawResponeDataResult[i].member[0];
+            responseForMember.result = convertToExpectedObjectsFormat(rawResponeDataResult[i].result, rawResponeDataResult[i].member[0][1]);
+            
+            // add into final results
+            finalResponseResults.push(responseForMember);
+          }
+        }
+      }
+    }
+  }
+  
+  finalResponseData.result = finalResponseResults;
+  //responseResult = finalResponseData;
+  return finalResponseData;
+}
+
+// Function for converting raw response into expected object wise results format
+function convertToExpectedObjectsFormat(rawResponseResult, prefixForId){
+  
+  var expResponseResult = new Array();
+  
+  if(rawResponseResult != null && rawResponseResult != undefined ){
+    
+    for(var i=0; i< rawResponseResult.length; i++){
+      if(rawResponseResult[i] != null){
+        
+        if(expResponseResult.length > 0){
+          // search expected object type in expResponseResult
+          var flagObjectFound = false;
+          for(var j=0 ; j < expResponseResult.length ; j++){
+            if(expResponseResult[j].objectType == rawResponseResult[i][0]){
+              // required object found
+              flagObjectFound = true;
+              var objectResults = expResponseResult[j].objectResults;
+              var type = rawResponseResult[i][0];
+              var entry = rawResponseResult[i][1];
+
+              // if entry is not object then convert it into object
+              if(typeof(entry) != "object" ){
+                var entryObj = {};
+                entryObj[type] = rawResponseResult[i][1];
+                entry = entryObj;
+              }
+
+              // add unique id for new entry
+              entry.uid = generateEntryUID(prefixForId, expResponseResult[j].objectType, objectResults.length);
+              
+              objectResults.push(entry);
+              break;
+            }
+          }
+          
+          if(!flagObjectFound){  // required object not found in expResponseResult 
+            
+            var objectResults = new Array();
+            var type = rawResponseResult[i][0];
+            var entry = rawResponseResult[i][1];
+
+            // if entry is not object then convert it into object
+            if(typeof(entry) != "object" ){
+              var entryObj = {};
+              entryObj[type] = rawResponseResult[i][1];
+              entry = entryObj;
+            }
+
+            // add unique id for new entry
+            entry.uid = generateEntryUID(prefixForId, type, objectResults.length);
+            
+            objectResults.push(entry);
+            
+            var newResultObject = {};
+            newResultObject.objectType = type;
+            newResultObject.objectResults = objectResults;
+            
+            expResponseResult.push(newResultObject);
+          }
+          
+        }else{  // expResponseResult is empty
+          
+          var objectResults = new Array();
+          var type = rawResponseResult[i][0];
+          var entry = rawResponseResult[i][1];
+
+          // if entry is not object then convert it into object
+          if(typeof(entry) != "object" ){
+            var entryObj = {};
+            entryObj[type] = rawResponseResult[i][1];
+            entry = entryObj;
+          }
+
+          // add unique id for new entry
+          entry.uid = generateEntryUID(prefixForId, type, objectResults.length);
+          
+          objectResults.push(entry);
+          
+          var newResultObject = {};
+          newResultObject.objectType = type;
+          newResultObject.objectResults = objectResults;
+          
+          expResponseResult.push(newResultObject);
+        }
+        
+      }
+    }
+  }
+  
+  return expResponseResult;
+}
+
+// Function to generate unique idetifier for entry
+function generateEntryUID(prefixForId, type, len) {
+
+  var uid = "";
+
+  if(type.indexOf("[]") != -1){
+    type = type.replace("[]","BxBr");
+  }
+
+  if (prefixForId != "") {
+    uid = prefixForId + "*" + type + "*" + len;
+  } else {
+    uid = type + "*" + len;
+  }
+
+  return uid;
+}
+
+// Function that posts the query result response received to backend in order
+// export it into file
+function exportResult() {
+  if(responseResult != undefined && responseResult !== null){
+    $.generateFile({
+      filename : 'export.json',
+      content : JSON.stringify(responseResult),
+      script : 'pulse/dataBrowserExport'
+    });
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQueryHistory.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQueryHistory.js b/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQueryHistory.js
new file mode 100644
index 0000000..a48aaff
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/pages/DataBrowserQueryHistory.js
@@ -0,0 +1,84 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+// DataBrowserQueryHistory.js
+// updateQueryHistory()
+function updateQueryHistory(action,queryId) {
+  
+  requestData = {
+    action:action,
+    queryId:queryId
+  };
+
+  $.getJSON("pulse/dataBrowserQueryHistory", requestData, function(data) {
+    
+    var queries = new Array();
+    if(data.queryHistory != undefined && data.queryHistory != null){
+      queries = data.queryHistory;
+    }
+    var refHistoryConatiner = $("#detailsHistoryList");
+    var queryListHTML = "";
+    if(queries.length == 0){
+      // no queries found
+      queryListHTML = "No Query Found";
+    }else{
+      queries.sort(dynamicSort("queryId", "desc"));
+      for(var i=0; i<queries.length && i<20; i++){
+        // add query item
+        queryListHTML += "" +
+          "<div class=\"container\">" +
+            "<div class=\"wrap\">" +
+              "<div class=\"read-more\">" +
+                "<a href=\"#\" class=\"remore_plus\">&nbsp;</a>" +
+              "</div>" +
+              "<div class=\"remove\">" +
+                "<a href=\"#\" onclick=\"updateQueryHistory('delete','"+ queries[i].queryId +"');\">&nbsp;</a>" +
+              "</div>" +
+              "<div class=\"wrapHistoryContent\"  ondblclick=\"queryHistoryItemClicked(this);\">" + queries[i].queryText +
+              "</div>" +
+              "<div class=\"dateTimeHistory\">" + queries[i].queryDateTime +
+              "</div>" +
+            "</div>" +
+          "</div>";
+      }
+    }
+    
+    refHistoryConatiner.html(queryListHTML);
+    //$('.queryHistoryScroll-pane').jScrollPane();/*Custome scroll*/    
+
+    // Set eventsAdded = false as list is refreshed and slide events 
+    // (for expanding and collapsing) are removed
+    eventsAdded = false;
+    
+  }).error(resErrHandler);
+   
+}
+
+// This function displays error if occurred 
+function resErrHandler(data){
+  // Check for unauthorized access
+  if (data.status == 401) {
+    // redirect user on Login Page
+    window.location.href = "Login.html?error=UNAUTH_ACCESS";
+  }else{
+    console.log(data);
+  }
+};
+
+// This function is called when any query from history list is double clicked 
+function queryHistoryItemClicked(divElement){
+  // Set selected query text into Query Editor
+  $('#dataBrowserQueryText').val(unescapeHTML(divElement.innerHTML));
+  //Enable Execute button
+  onQueryTextChange();
+  // fire a click event on document to hide history panel
+  $(document).click();
+  
+  
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/pages/Login.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/pages/Login.js b/pulse/src/main/webapp/scripts/pulsescript/pages/Login.js
new file mode 100644
index 0000000..b825f0d
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/pages/Login.js
@@ -0,0 +1,159 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+$(document).ready(function() {
+  
+  // determine pulse back end product
+  $.ajax({
+    url : 'pulse/pulseProductSupport',
+    type : 'GET',
+    dataType : 'json',
+    async : true,
+    success : function(data) {
+      // Set product name in cookie
+      setCookie('productname', data.product, 1);
+
+      // modify UI text as per requirement
+      customizeUI();
+      
+    },
+    error: function(jqXHR, textStatus, errorThrown){
+
+      $('#user_name').prop('disabled', true);
+      $('#user_password').prop('disabled', true);
+      $('input[type="submit"]').prop('disabled', true);
+      $("#errorText").html("Unable to determine backend product [Gemfire / SQLfire]<br>"+textStatus);
+      $("#errorMasterBlock").show();
+    }
+  });
+  
+});
+
+// this function is called when login page loads
+function pageOnLoad(){
+  // get Pulse Version Details
+  getPulseVersion();
+  
+  $.getJSON("pulse/authenticateUser", function(data) {
+    
+    // return isUserLoggedIn
+    if(data.isUserLoggedIn){
+      // redirect user on Login Page 
+      window.location.href = "clusterDetail.html";
+    }else{
+      
+      // check if host and port available
+      /*
+      var cookieHost = getCookie('host');
+      var cookiePort = getCookie('port');
+      
+      if(cookieHost != null && cookieHost != undefined && cookieHost != '' ){
+        $("#locator_host").val(cookieHost);
+        $("#locator_host").hide();
+      }
+      
+      if(cookiePort != null && cookiePort != undefined && cookiePort != '' ){
+        $("#locator_port").val(cookiePort);
+        $("#locator_port").hide();
+      }*/
+      
+      var errorId = GetParam('error');
+      if(errorId != ''){
+        //$("#errorText").html('<span>'+errorText+'</span>');
+        displayErrorMessage(errorId);
+      }
+    }
+
+  }).error(function(data){
+    // Display Error
+    var errorId = GetParam('error');
+    if(errorId != ''){
+      //$("#errorText").html('<span>'+errorText+'</span>');
+      displayErrorMessage(errorId);
+    }
+  });
+  
+}
+
+function displayErrorMessage(errorId){
+  var errorText = getErrorMessage(errorId);
+  if(errorText != ""){
+    errorText = "<span>"+errorText+"<span>";
+    $("#errorText").html(errorText);
+    $("#errorMasterBlock").show();
+  }
+}
+function getErrorMessage(errorId){
+  var errorText = "";
+  switch(errorId){
+    case 'AUTH_FAILED' : 
+      errorText = "Authentication Failed";
+      break;
+      
+    case 'BAD_CREDS' : 
+      errorText = "Incorrect Username or password";
+      break;
+      
+    case 'CRED_EXP' : 
+      errorText = "Your Account is expired";
+      break;
+      
+    case 'ACC_LOCKED' : 
+      errorText = "Your account is locked";
+      break;
+      
+    case 'ACC_DISABLED' : 
+      errorText = "Your account is disabled";
+      break;
+      
+    case 'UNAUTH_ACCESS' : 
+      errorText = "HTTP Error 401 : Unauthorized Access";
+      break;
+      
+    default : 
+      errorText = "";
+  }
+  
+  return errorText;
+}
+
+// function to validate the user inputs
+function validate(){
+  var valid = true;
+  var errorText = "";
+  /*
+  //validation logic here , change valid to false if fail
+  if($("#user_name").val() == undefined || $("#user_name").val() == null || $("#user_name").val() == ''){
+    valid = false;
+    errorText += '<span>Please enter User Name</span>';
+  }
+  
+  if($("#user_password").val() == undefined || $("#user_password").val() == null || $("#user_password").val() == ''){
+    valid = false;
+    errorText += '<span>Please enter Password</span>';
+  }
+  
+  // optional fields
+  if($("#locator_host").val() == undefined || $("#locator_host").val() == null || $("#locator_host").val() == ''){
+    valid = false;
+    errorText += '<span>Please enter Locator Host</span>';
+  }
+  
+  if($("#locator_port").val() == undefined || $("#locator_port").val() == null || $("#locator_port").val() == ''){
+    valid = false;
+    errorText += '<span>Please enter Locator Port</span>';
+  }*/
+  
+  if(!valid){
+    $("#errorText").html(errorText);
+    $("#errorMasterBlock").show();
+  }else{
+    $("#errorMasterBlock").hide();
+  }
+  return valid;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/pages/index.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/pages/index.js b/pulse/src/main/webapp/scripts/pulsescript/pages/index.js
new file mode 100644
index 0000000..51f368f
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/pages/index.js
@@ -0,0 +1,15 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+/**
+ * This JS File is used as home page of the application
+ * 
+ */
+$(document).ready(function() {
+  changeLocale('', 'index');
+});

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/queryStatistics.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/queryStatistics.js b/pulse/src/main/webapp/scripts/pulsescript/queryStatistics.js
new file mode 100644
index 0000000..2033fa7
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/queryStatistics.js
@@ -0,0 +1,304 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+/**
+ * This JS File is used for Cluster Details screen
+ * 
+ */
+var grid = null;
+var gridFilterReset = true;
+
+$(document).ready(function() {
+
+  // Load Notification HTML  
+  generateNotificationsPanel();
+
+  // modify UI text as per requirement
+  customizeUI();
+
+  if (CONST_BACKEND_PRODUCT_SQLFIRE == productname.toLowerCase()) {
+    // Do nothing
+  } else {
+    // Redirect to Cluster details page
+    openClusterDetail();
+  }
+  scanPageForWidgets();
+
+  // creating blank query statistics grid
+  createQueryStatisticsGrid();
+
+  // setup the options with check boxes and show hide functionality using
+  // library
+  setupColumnSelection();
+
+  $.ajaxSetup({
+    cache : false
+  });
+});
+
+/*
+ * Function to sort integer column which will show text NA
+ */
+var customSortFunction = function(cell, rowObject) {
+  if (cell == 'NA') {
+    return -1;
+  } else {
+    return parseInt(cell);
+  }
+};
+
+function createQueryStatisticsGrid() {
+
+  $.ajax({
+    url : 'pulse/getQueryStatisticsGridModel',
+    type : 'GET',
+    dataType : 'json',
+    async : false,
+    success : function(data) {
+
+      // set cluster name in tab
+      $('#clusterName').html(data.clusterName);
+      $('#userName').html(data.userName);
+
+      // add column selection options
+      for ( var i = 1; i < data.columnNames.length; ++i) {
+        $('#columnsSelect').append(
+            '<option value = "' + data.columnModels[i].name + '">'
+                + data.columnNames[i] + '</option>');
+      }
+
+      // one-time setup for column sorting for integer columns here
+      for ( var i = 0; i < data.columnModels.length; ++i) {
+        if (data.columnModels[i].sorttype == 'integer') {
+          data.columnModels[i].sorttype = customSortFunction;
+        }
+      }
+
+      grid = $("#queryStatisticsList");
+      grid.jqGrid({
+        datatype : "local",
+        height : 710,
+        width : 1000,
+        rowNum : 50,
+        sortname : data.columnModels[1].name,
+        sortorder: "desc",
+        shrinkToFit : false,
+        ignoreCase: true,
+        colNames : data.columnNames,
+        colModel : data.columnModels,
+        userData : {
+          "sortOrder" : "desc",
+          "sortColName" : data.columnModels[1].name
+        },
+        onSortCol : function(columnName, columnIndex, sortorder) {
+          // Set sort order and sort column in user variables so that
+          // periodical updates can maintain the same
+          var gridUserData = jQuery("#queryStatisticsList").getGridParam(
+              'userData');
+          gridUserData.sortColName = columnName;
+          gridUserData.sortOrder = sortorder;
+          
+          jQuery("#queryStatisticsList").trigger("reloadGrid");
+          var queryStatisticsList = $('#gview_queryStatisticsList');
+          var queryStatisticsListChild = queryStatisticsList
+              .children('.ui-jqgrid-bdiv');
+          var api = queryStatisticsListChild.data('jsp');
+          api.reinitialise();
+
+          $('#queryStatisticsList').toggle();
+          refreshTheGrid($('#queryStatisticsList'));
+        },
+        resizeStop : function(width, index) {
+          var queryStatisticsList = $('#gview_queryStatisticsList');
+          var queryStatisticsListChild = queryStatisticsList
+              .children('.ui-jqgrid-bdiv');
+          var api = queryStatisticsListChild.data('jsp');
+          api.reinitialise();
+
+          $('#queryStatisticsList').toggle();
+          refreshTheGrid($('#queryStatisticsList'));
+        },
+        gridComplete : function() {
+          $(".jqgrow").css({
+            cursor : 'default'
+          });
+          
+          // wrap contents of query statistics table cells only - not other grids
+          $(".jqgrow td").css('word-wrap', 'break-word');
+          $(".jqgrow td").css('white-space', 'pre-wrap');
+          $(".jqgrow td").css('white-space', '-pre-wrap');
+          $(".jqgrow td").css('white-space', '-o-pre-wrap');
+          $(".jqgrow td").css('white-space', 'normal !important');
+          $(".jqgrow td").css('height', 'auto');
+          $(".jqgrow td").css('vertical-align', 'text-top');
+          $(".jqgrow td").css('padding-top', '2px');
+          $(".jqgrow td").css('padding-bottom', '3px');
+
+          var queryStatisticsList = $('#gview_queryStatisticsList');
+          var queryStatisticsListChild = queryStatisticsList
+              .children('.ui-jqgrid-bdiv');
+
+          queryStatisticsListChild.unbind('jsp-scroll-x');
+          queryStatisticsListChild.bind('jsp-scroll-x', function(event,
+              scrollPositionX, isAtLeft, isAtRight) {
+            var qsList = $('#gview_queryStatisticsList');
+            var qsLC = qsList.children('.ui-jqgrid-hdiv').children(
+                '.ui-jqgrid-hbox');
+            qsLC.css("position", "relative");
+            qsLC.css('right', scrollPositionX);
+          });
+        }
+      });
+
+      $('.ui-jqgrid-bdiv').each(function(index) {
+        var tempName = $(this).parent().attr('id');
+        if (tempName == 'gview_queryStatisticsList') {
+          $(this).jScrollPane();
+        }
+      });
+    }
+  });
+}
+
+function setupColumnSelection() {
+
+  $("select").multiselect(
+      {
+        click : function(event, ui) {
+          // hide selected column
+          if (ui.checked) {
+            grid.jqGrid('hideCol', ui.value);
+          } else {
+            grid.jqGrid('showCol', ui.value);
+          }
+
+          grid.trigger("reloadGrid", [ {
+            page : 1
+          } ]);
+          destroyScrollPane('gview_queryStatisticsList');
+          $('.ui-jqgrid-bdiv').each(function(index) {
+            var tempName = $(this).parent().attr('id');
+            if (tempName == 'gview_queryStatisticsList') {
+              $(this).jScrollPane();
+            }
+          });
+        },
+        checkAll : function() {
+          // hide all columns
+          var colModels = grid.jqGrid('getGridParam', 'colModel');
+          for ( var i = 1; i < colModels.length; i++) {
+            grid.jqGrid('hideCol', colModels[i].name);
+          }
+
+          grid.trigger("reloadGrid", [ {
+            page : 1
+          } ]);
+          destroyScrollPane('gview_queryStatisticsList');
+          $('.ui-jqgrid-bdiv').each(function(index) {
+            var tempName = $(this).parent().attr('id');
+            if (tempName == 'gview_queryStatisticsList') {
+              $(this).jScrollPane();
+            }
+          });  
+        },
+        uncheckAll : function() {
+          // show all columns
+          var colModels = grid.jqGrid('getGridParam', 'colModel');
+          for ( var i = 1; i < colModels.length; i++) {
+            grid.jqGrid('showCol', colModels[i].name);
+          }
+          grid.trigger("reloadGrid", [ {
+            page : 1
+          } ]);
+
+          destroyScrollPane('gview_queryStatisticsList');
+          $('.ui-jqgrid-bdiv').each(function(index) {
+            var tempName = $(this).parent().attr('id');
+            if (tempName == 'gview_queryStatisticsList') {
+              $(this).jScrollPane();
+            }
+          });
+        }
+      });
+}
+
+var applyFilterOnQueryStatistics = function() {
+  
+  var searchKeyword = $('#filterQueryStatisticsBox').val();
+  if(searchKeyword.length < 4){
+    
+    if(! gridFilterReset){
+      gridFilterReset = true; // do not filter grid till reset
+
+      ///filter only after string length 4 else reset filter
+      grid[0].p.search = false;
+      grid.trigger("reloadGrid", [ {
+        page : 1
+      } ]);
+     
+      // trigger check for scroll pane to see if scroll bars need to be shown
+      var queryStatisticsList = $('#gview_queryStatisticsList');
+      var queryStatisticsListChild = queryStatisticsList
+          .children('.ui-jqgrid-bdiv');
+      var api = queryStatisticsListChild.data('jsp');
+      api.reinitialise();
+  
+      // scroll to top of grid to ensure all records are displayed in the view port
+      api.scrollToY(0, false);
+  
+      $('#queryStatisticsList').toggle();
+      refreshTheGrid($('#queryStatisticsList'));
+    }
+    
+    return;
+  }
+  
+  gridFilterReset = false; // set to start filtering grid
+  if ((searchKeyword != "Search") && (searchKeyword != "")) {
+    var myfilter = {
+      groupOp : "AND",
+      rules : [ {
+        field : "Query",
+        op : "cn",
+        data : searchKeyword
+      } ]
+    };
+
+    grid[0].p.search = myfilter.rules.length > 0;
+    $.extend(grid[0].p.postData, {
+      filters : JSON.stringify(myfilter)
+    });
+  } else {
+    grid[0].p.search = false;
+  }
+
+  grid.trigger("reloadGrid", [ {
+    page : 1
+  } ]);
+ 
+  // trigger check for scroll pane to see if scroll bars need to be shown
+  var queryStatisticsList = $('#gview_queryStatisticsList');
+  var queryStatisticsListChild = queryStatisticsList
+      .children('.ui-jqgrid-bdiv');
+  var api = queryStatisticsListChild.data('jsp');
+  api.reinitialise();
+
+  // scroll to top of grid to ensure all records are displayed in the view port
+  api.scrollToY(0, false);
+
+  $('#queryStatisticsList').toggle();
+  refreshTheGrid($('#queryStatisticsList'));
+};
+
+function showQueryStatistics(data) {
+  getQueryStatisticsBack(data.QueryStatistics);
+}
+
+function refreshTheGrid(gridDiv) {
+  setTimeout(function(){gridDiv.toggle();}, 500);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/main/webapp/scripts/pulsescript/regionView.js
----------------------------------------------------------------------
diff --git a/pulse/src/main/webapp/scripts/pulsescript/regionView.js b/pulse/src/main/webapp/scripts/pulsescript/regionView.js
new file mode 100644
index 0000000..a22f2c6
--- /dev/null
+++ b/pulse/src/main/webapp/scripts/pulsescript/regionView.js
@@ -0,0 +1,746 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+/* Region Details javascript with pop-up with spark-lines opening from each tree-map cell showing member level region information.
+ * This page opens from Data view on cluster page and links to member details page by clicking on tree map cell.
+ *
+ * @author Riya Bhandekar
+ * @since version 7.5 Cedar 2014-03-01
+ *
+ */
+
+
+// required global variables
+var regionMemberTreeMap;
+var tipObj = null;
+var theTooltip = null;
+var memberList = null;
+var memberOnRegionJson = null;
+var clusterDataViewRegions;
+var regionMembers = null;
+
+/**
+ * This JS File is used for Cluster Details screen
+ * 
+ */
+$(document).ready(function() {
+
+  // Load Notification HTML  
+  generateNotificationsPanel();
+
+  if (CONST_BACKEND_PRODUCT_SQLFIRE == productname.toLowerCase()) {
+    alterHtmlContainer(CONST_BACKEND_PRODUCT_SQLFIRE);
+  } else {
+    alterHtmlContainer(CONST_BACKEND_PRODUCT_GEMFIRE);
+  }
+
+  createMemberTreeMap();
+  
+  createMemberGrid();
+  
+	// scan page for widgets
+  scanPageForWidgets();
+
+  $.ajaxSetup({
+    cache : false
+  });
+});
+
+/*
+ * Function to show and hide html elements/components based upon whether product
+ * is sqlfire or gemfire 
+ */
+function alterHtmlContainer(prodname){
+  if(CONST_BACKEND_PRODUCT_SQLFIRE == prodname.toLowerCase()){
+    // Show HTML for following
+    $('#subTabQueryStatistics').show();
+  }else{
+    // Hide HTML for following
+    $('#subTabQueryStatistics').hide();
+  }  
+}
+
+//function used for applying filter of member names in data view screen
+var applyFilterOnMembersList = function() {
+  var searchKeyword = extractFilterTextFrom('filterMembersListBox');
+  var htmlMemberListWithFilter = '';
+  if (searchKeyword != "") {
+    for ( var i = 0; i < memberList.length; i++) {
+      // filtered list
+      if (memberList[i].name.toLowerCase().indexOf(searchKeyword) !== -1) {
+        var divId = memberList[i].memberId + "&" + memberList[i].name;
+        htmlMemberListWithFilter += "<div class='pointDetailsPadding' title='"
+            + memberList[i].name + "' id='" + divId
+            + "' onClick = 'javascript:openMemberDetails(this.id)'>"
+            + memberList[i].name + "</div>";
+      }
+    }
+  } else {
+    for ( var i = 0; i < memberList.length; i++) {
+      // non filtered list
+      var divId = memberList[i].memberId + "&" + memberList[i].name;
+      htmlMemberListWithFilter += "<div class='pointDetailsPadding' title='"
+          + memberList[i].name + "' id='" + divId
+          + "' onClick = 'javascript:openMemberDetails(this.id)'>"
+          + memberList[i].name + "</div>";
+    }
+  }
+  document.getElementById("memberNames").innerHTML = htmlMemberListWithFilter;
+  $('.regionMembersSearchBlock').jScrollPane();
+};
+
+
+//function used for applying filter of region's members treemap and grid
+var applyFilterOnRegionMembers = function() {
+  //console.log("applyFilterOnRegionMembers called");
+  var searchKeyword = extractFilterTextFrom("filterRegionMembersBox");
+
+  if (searchKeyword != "") {
+    var filteredRegionMembers = {};
+    for (var regMemKey in regionMembers) {
+      var regionMember = regionMembers[regMemKey];
+      // filtered list
+      if (regionMember.memberName.toLowerCase().indexOf(searchKeyword) !== -1) {
+        filteredRegionMembers[regionMember.memberName] = regionMember;
+      }
+    }
+    updateClusterSelectedRegionMembers(filteredRegionMembers);
+  } else {
+    updateClusterSelectedRegionMembers(regionMembers);
+  }
+};
+
+
+function initializeSparklinesToZero(spo){
+  var arrZero = [0,0,0,0,0,0,0];
+  tipObj.find('#memberMemoryReadsTrend').sparkline(arrZero,spo);
+  tipObj.find('#memberDiskReadsTrend').sparkline(arrZero,spo);
+  spo.lineColor = '#2e84bb';
+  tipObj.find('#memberMemoryWritesTrend').sparkline(arrZero,spo);
+  tipObj.find('#memberDiskWritesTrend').sparkline(arrZero,spo);
+}
+
+
+function displaySelectedRegionDetails(regionName, data){
+  
+  $('#regionPath').html(data.selectedRegion.path);
+  $('#regionType').html(data.selectedRegion.type);
+  $('#regionMembersText').html(data.selectedRegion.memberCount);
+  $('#regionNameText').html(data.selectedRegion.name);
+  $('#regionEntryCountText').html(data.selectedRegion.entryCount);
+  $('#regionEntrySizeText').html(data.selectedRegion.entrySize);
+  
+  $('#regionPersistence').html(data.selectedRegion.persistence);
+  $('#regionDiskUsage').html(data.selectedRegion.dataUsage);
+  //$('#regionIsEnableOffHeapMemory').html(data.selectedRegion.isEnableOffHeapMemory);
+  //$('#regionIsHdfsWriteOnly').html(data.selectedRegion.isHDFSWriteOnly);
+  $('#regionEmptyNodes').html(data.selectedRegion.emptyNodes);
+  
+  //memberList = data.selectedRegion.members;
+  //applyFilterOnMembersList();
+  
+  var memoryUsagePer = (data.selectedRegion.memoryUsage / data.selectedRegion.totalMemory) * 100;
+  memoryUsagePer = isNaN(memoryUsagePer) ? 0 : memoryUsagePer;
+  var memPer = memoryUsagePer + "%";
+  document.getElementById("memoryUsage").style.width = memPer;
+
+  memoryUsagePer = parseFloat(memoryUsagePer);
+  $('#memoryUsageVal').html(memoryUsagePer.toFixed(4));
+
+  if (data.selectedRegion.memoryUsage == 0) {
+    document.getElementById("memoryUsed").innerHTML = "-";
+    document.getElementById("memoryUsedMBSpan").innerHTML = "";
+  } else
+    document.getElementById("memoryUsed").innerHTML = data.selectedRegion.memoryUsage;
+  document.getElementById("totalMemory").innerHTML = data.selectedRegion.totalMemory;
+
+  //theTooltip
+  if(theTooltip != null){
+    if(theTooltip.isShown(false)){
+      theTooltip.hide();
+      $('#region_tooltip').css('display','none');
+    }
+  }
+  
+  // delete tooltips here
+  $('#region_tooltip').remove();
+  
+  var sparklineOptions = {
+      width : '217px',
+      height : '72px',
+      lineColor : '#FAB948',
+      fillColor : false,
+      spotRadius : 2.5,
+      labelPosition : 'left',
+      spotColor : false,
+      minSpotColor : false,
+      maxSpotColor : false,
+      lineWidth : 2
+  };
+  
+  var reads = data.selectedRegion.memoryReadsTrend;
+  var diskReads = data.selectedRegion.diskReadsTrend;
+  var writes = data.selectedRegion.memoryWritesTrend;
+  var diskWrites = data.selectedRegion.diskWritesTrend;
+  
+  // Reads trends  
+  $('#readsPerSecTrend').sparkline(reads, sparklineOptions);
+  $('#diskReadsPerSecTrend').sparkline(diskReads, sparklineOptions);
+  
+  // Writes trends
+  sparklineOptions.lineColor = '#2e84bb';
+  $('#writesPerSecTrend').sparkline(writes, sparklineOptions);
+  $('#diskWritesPerSecTrend').sparkline(diskWrites, sparklineOptions);
+
+  var sumReads = 0;
+  var avgReads = 0;
+  if (reads.length > 0) {
+    for ( var i = 0; i < reads.length; i++) {
+      sumReads += parseFloat(reads[i]);
+    }
+    avgReads = sumReads / reads.length;
+  }
+  $('#currentReadsPerSec').html(applyNotApplicableCheck(avgReads.toFixed(2)));  
+
+  var sumDiskReads = 0;
+  var avgDiskReads = 0;
+  if (diskReads.length > 0) {
+    for ( var i = 0; i < diskReads.length; i++) {
+      sumDiskReads += parseFloat(diskReads[i]);
+    }
+    avgDiskReads = sumDiskReads / diskReads.length;
+  }
+  $('#currentDiskReadsPerSec').html(
+      applyNotApplicableCheck(avgDiskReads.toFixed(2)));
+  
+  var sumWrites = 0;
+  var avgWrites = 0;
+  if (writes.length > 0) {
+    for ( var i = 0; i < writes.length; i++) {
+      sumWrites += parseFloat(writes[i]);
+    }
+    avgWrites = sumWrites / writes.length;
+  }
+  $('#currentWritesPerSec').html(applyNotApplicableCheck(avgWrites.toFixed(2)));
+
+  
+  var sumDiskWrites = 0;
+  var avgDiskWrites = 0;
+  if (diskWrites.length > 0) {
+    for ( var i = 0; i < diskWrites.length; i++) {
+      sumDiskWrites += parseFloat(diskWrites[i]);
+    }
+    avgDiskWrites = sumDiskWrites / diskWrites.length;
+  }
+  $('#currentDiskWritesPerSec').html(
+      applyNotApplicableCheck(avgDiskWrites.toFixed(2)));
+  
+  var popupDiv = $('#popupDiv').html();
+  $(".node").attr('title',popupDiv);
+  $(".node").tooltip({
+    
+    onBeforeShow: function() {
+      if(theTooltip != null){
+        if(theTooltip.isShown(false)){
+          theTooltip.hide();
+        }
+      }
+    },
+    onShow: function() {
+      tipObj = this.getTip(); //global store
+      theTooltip = this;
+
+      var nodeId = this.getTrigger().attr('id');
+      var memberName = nodeId;
+      var spo = {
+          width : '110px',
+          height : '50px',
+          lineColor : '#FAB948',
+          fillColor : '#0F1C25',
+          spotRadius : 2.5,
+          labelPosition : 'left',
+          spotColor : false,
+          minSpotColor : false,
+          maxSpotColor : false,
+          lineWidth : 2
+      };
+      
+      initializeSparklinesToZero(spo); 
+      spo.lineColor='#FAB948';
+      $.sparkline_display_visible();
+    
+      //region member specific statistics 
+      tipObj.find('#idMemberName').html(memberName);
+      
+      var key = 'memberOnRegionJson.' + memberName + '.entryCount';
+      tipObj.find('#regionMemberEntryCount').html(eval(key));
+      key = 'memberOnRegionJson.' + memberName + '.entrySize';
+      tipObj.find('#regionMemberEntrySize').html(eval(key));
+      key = 'memberOnRegionJson.' + memberName + '.accessor';
+      //tipObj.find('#regionMemberAccessor').html('False');
+      tipObj.find('#regionMemberAccessor').html(eval(key));
+      
+      key = 'memberOnRegionJson.' + memberName + '.memoryReadsTrend';
+      tipObj.find('#memberMemoryReadsTrend').sparkline(eval(key),spo);
+      var reads = eval(key); // store
+      key = 'memberOnRegionJson.' + memberName + '.diskReadsTrend';
+      tipObj.find('#memberDiskReadsTrend').sparkline(eval(key),spo);
+      var diskReads = eval(key); // store
+      
+      // Writes trends
+      spo.lineColor = '#2e84bb';
+      key = 'memberOnRegionJson.' + memberName + '.memoryWritesTrend';
+      tipObj.find('#memberMemoryWritesTrend').sparkline(eval(key),spo);
+      var writes = eval(key); // store
+      key = 'memberOnRegionJson.' + memberName + '.diskWritesTrend';
+      tipObj.find('#memberDiskWritesTrend').sparkline(eval(key),spo);
+      var diskWrites = eval(key); // store
+            
+      $.sparkline_display_visible();
+      
+      var sumReads = 0;
+      var avgReads = 0;
+      if (reads.length > 0) {
+        for ( var i = 0; i < reads.length; i++) {
+          sumReads += parseFloat(reads[i]);
+        }
+        avgReads = sumReads / reads.length;
+      }
+      $('#memberMemoryReadsThroughput').html(applyNotApplicableCheck(avgReads.toFixed(2)));  
+
+      var sumDiskReads = 0;
+      var avgDiskReads = 0;
+      if (diskReads.length > 0) {
+        for ( var i = 0; i < diskReads.length; i++) {
+          sumDiskReads += parseFloat(diskReads[i]);
+        }
+        avgDiskReads = sumDiskReads / diskReads.length;
+      }
+      $('#memberDiskReadsThroughput').html(
+          applyNotApplicableCheck(avgDiskReads.toFixed(2)));
+      
+      var sumWrites = 0;
+      var avgWrites = 0;
+      if (writes.length > 0) {
+        for ( var i = 0; i < writes.length; i++) {
+          sumWrites += parseFloat(writes[i]);
+        }
+        avgWrites = sumWrites / writes.length;
+      }
+      $('#memberMemoryWritesThroughput').html(applyNotApplicableCheck(avgWrites.toFixed(2)));
+
+      
+      var sumDiskWrites = 0;
+      var avgDiskWrites = 0;
+      if (diskWrites.length > 0) {
+        for ( var i = 0; i < diskWrites.length; i++) {
+          sumDiskWrites += parseFloat(diskWrites[i]);
+        }
+        avgDiskWrites = sumDiskWrites / diskWrites.length;
+      }
+      $('#memberDiskWritesThroughput').html(applyNotApplicableCheck(avgDiskWrites.toFixed(2)));
+    },
+    onHide: function(){
+      $('#region_tooltip').css('display','none');
+      tipObj = null; // reset
+
+      theTooltip = null;
+    },
+     // custom positioning
+    position: 'bottom right',
+    
+    relative: false,
+      
+    // move tooltip a little bit to the right
+    offset: [-350, 10]});
+}
+
+function updateSelectedRegionMembersGrid(regMembers){
+
+  // loads grid
+  $('#memberList').jqGrid('clearGridData');
+
+  // Add memebers in grid
+  for (var key in regMembers){
+    var regMemData = regMembers[key];
+    $('#memberList').jqGrid('addRowData',
+        regMemData.memberId + "&" + regMemData.memberName, regMemData);
+  }
+
+  var gridUserData = jQuery("#memberList").getGridParam('userData');
+
+  // Apply sort order ans sort columns on updated jqgrid data
+  jQuery("#memberList").jqGrid('setGridParam', {
+    sortname : gridUserData.sortColName,
+    sortorder : gridUserData.sortOrder
+  });
+  // Reload jqgrid
+  jQuery("#memberList").trigger("reloadGrid");
+
+  // apply scroll if grid container block is not minimized
+  if ($("#LargeBlock_1").css("display") != "none") {
+    $('.ui-jqgrid-bdiv').each(function(index) {
+      var tempName = $(this).parent().attr('id');
+      if (tempName == 'gview_memberList') {
+        $(this).jScrollPane({maintainPosition : true, stickToRight : true});
+      }
+    });
+
+    var memberRegionsList = $('#gview_memberList');
+    memberRegionsListChild = memberRegionsList
+           .children('.ui-jqgrid-bdiv');
+    memberRegionsListChild.unbind('jsp-scroll-x');
+    memberRegionsListChild.bind('jsp-scroll-x', function(event,
+           scrollPositionX, isAtLeft, isAtRight) {
+
+        var mRList = $('#gview_memberList');
+        var mRLC = mRList.children('.ui-jqgrid-hdiv').children(
+             '.ui-jqgrid-hbox');
+        mRLC.css("position", "relative");
+        mRLC.css('right', scrollPositionX);
+    });
+  }
+}
+
+//function used for creating blank TreeMap for member's on Cluster Details
+//Screen
+function createMemberTreeMap() {
+    
+    var dataVal = {
+      "$area" : 1,
+      "initial" : true
+    };
+    var json = {
+      "children" : {},
+      "data" : dataVal,
+      "id" : "root",
+      "name" : "Members"
+    };
+    
+    regionMemberTreeMap = new $jit.TM.Squarified(
+        {
+
+          injectInto : 'GraphTreeMap',
+          levelsToShow : 1,
+          titleHeight : 0,
+          background : '#a0c44a',
+          offset : 2,
+          Label : {
+            type : 'HTML',
+            size : 1
+          },
+          Node : {
+            CanvasStyles : {
+              shadowBlur : 0
+            }
+          },
+          Events : {
+            enable : true,
+            onMouseEnter : function(node, eventInfo) {
+              if (node) {
+                node.setCanvasStyle('shadowBlur', 7);
+                node.setData('border', '#ffffff');
+
+                regionMemberTreeMap.fx.plotNode(node,
+                    regionMemberTreeMap.canvas);
+                regionMemberTreeMap.labels.plotLabel(
+                    regionMemberTreeMap.canvas, node);
+              }
+            },
+            onMouseLeave : function(node) {
+              if (node) {
+                node.removeData('border', '#ffffff');
+                node.removeCanvasStyle('shadowBlur');
+                regionMemberTreeMap.plot();
+              }
+            },
+            onClick : function(node) {
+              if (node.id != "root") {
+                location.href ='MemberDetails.html?member=' + node.id + "&memberName=" + node.name;
+              }
+            }
+          },
+
+          Tips : {
+            enable : false,
+            offsetX : 5,
+            offsetY : 5,
+            onShow : function(tip, node, isLeaf, domElement) {
+              var html = "<div class=\"tip-title\"><div><div class='popupHeading'>This region does not exist.</div>";
+              tip.innerHTML = html;
+            }
+          },
+          onCreateLabel : function(domElement, node) {
+            domElement.style.opacity = 0.01;
+
+          }
+        });
+    regionMemberTreeMap.loadJSON(json);
+    regionMemberTreeMap.refresh();
+    $(".node").attr('title',"<div class=\"tip-title\"><div><div class='popupHeading'>This region does not exist.</div></div></div>");
+    $(".node").tooltip({
+      
+      data : $(this).tagName,
+      onShow: function() {
+        tipObj = this.getTip(); //global store 
+      },
+      onHide: function(){
+        tipObj = null; // reset
+      },
+       // custom positioning
+      position: 'bottom right',
+      
+      relative: false,
+        
+      // move tooltip a little bit to the right
+      offset: [-350, 10]});
+}
+
+/* builds and returns json from given members details sent by server */
+function buildMemberTreeMap(members) {
+
+  var childerensVal = [];
+  var indexOfChild = 0;
+  for(var memKey in members){
+
+    var regMember = members[memKey];
+
+    var color = "#a0c44a";
+    // setting node color according to the status of member
+    // like if member has severe notification then the node color will be
+    // '#ebbf0f'
+    for ( var j = 0; j < warningAlerts.length; j++) {
+      if (regMember.memberName == warningAlerts[j].memberName) {
+        color = '#ebbf0f';
+        break;
+      }
+    }
+    // if member has severe notification then the node color will be
+    // '#de5a25'
+    for ( var j = 0; j < errorAlerts.length; j++) {
+      if (regMember.memberName == errorAlerts[j].memberName) {
+        color = '#de5a25';
+        break;
+      }
+    }
+    // if member has severe notification then the node color will be
+    // '#b82811'
+    for ( var j = 0; j < severAlerts.length; j++) {
+      if (regMember.memberName == severAlerts[j].memberName) {
+        color = '#b82811';
+        break;
+      }
+    }
+    
+    var areaSize = regMember.entryCount;
+    if (areaSize == 0)
+      areaSize = 1;
+    var name = "";
+    name = regMember.memberName;
+    var id = "";
+    id = regMember.memberName;
+    // passing all the required information of member to tooltip
+    var dataVal = {
+      "name" : name,
+      "id" : id,
+      "$color" : color,
+      "$area" : areaSize,
+      "entryCount" : regMember.entryCount,
+      "entrySize" : regMember.entrySize,
+      "accessor" : regMember.accessor,
+      "initial" : false
+    };
+    var childrenVal = {
+      "children" : [],
+      "data" : dataVal,
+      "id" : id,
+      "name" : name
+    };
+    childerensVal[indexOfChild++] = childrenVal;
+  }
+  
+  var localjson = {
+    "children" : childerensVal,
+    "data" : {},
+    "id" : "root",
+    "name" : "Members"
+  };
+  return localjson;
+}
+
+function tabClusterGrid() {
+  flagActiveTab = "MEM_GRID"; // MEM_TREE_MAP, MEM_GRID
+  
+  $('#btngridIcon').addClass('gridIconActive');
+  $('#btngridIcon').removeClass('gridIcon');
+
+  $('#btnchartIcon').addClass('chartIcon');
+  $('#btnchartIcon').removeClass('chartIconActive');
+
+  $('#chartBlocks_Panel').hide();
+  destroyScrollPane('gview_memberList');
+  $('.ui-jqgrid-bdiv').each(function(index) {
+      var tempName = $(this).parent().attr('id');
+      if (tempName == 'gview_memberList') {
+        $(this).jScrollPane({maintainPosition : true, stickToRight : true});
+      }
+  });
+  $('#gridBlocks_Panel').show();
+  jQuery("#memberList").trigger("reloadGrid");
+}
+
+function tabTreeMap() {
+  flagActiveTab = "MEM_TREE_MAP"; // MEM_TREE_MAP, MEM_GRID
+
+  $('#gridBlocks_Panel').hide();
+  $('#chartBlocks_Panel').show();
+
+  $('#btngridIcon').addClass('gridIcon');
+  $('#btngridIcon').removeClass('gridIconActive');
+
+  $('#btnchartIcon').addClass('chartIconActive');
+  $('#btnchartIcon').removeClass('chartIcon');
+
+  regionMemberTreeMap.loadJSON(globalJson);
+  regionMemberTreeMap.refresh();
+}
+
+//function used for creating blank grids for member list for Cluster Details
+//Screen
+function createMemberGrid() {
+jQuery("#memberList").jqGrid(
+ {
+   datatype : "local",
+   height : 560,
+   width : 410,
+   rowNum : 200,
+   shrinkToFit : false,
+   colNames : [ 'Member', 'Entry Count', 'Entry Size', 'Accessor'],
+   colModel : [
+       {
+         name : 'memberName',
+         index : 'memberName',
+         width : 120,
+         cellattr : function(rowId, val, rawObject, cm, rdata) {
+           return 'title="Member: ' + rawObject.memberName + ' , Entry Count: '
+               + rawObject.entryCount + ' , Entry Size: '
+               + rawObject.entrySize + ' , Accessor: '
+               + rawObject.accessor + '"';
+         },
+         sortable : true,
+         sorttype : "string"
+       },
+       {
+         name : 'entryCount',
+         index : 'entryCount',
+         width : 90,
+         align : 'right',
+         cellattr : function(rowId, val, rawObject, cm, rdata) {
+           return 'title="Member: ' + rawObject.memberName + ' , Entry Count: '
+           + rawObject.entryCount + ' , Entry Size: '
+           + rawObject.entrySize + ' , Accessor: '
+           + rawObject.accessor + '"';
+         },
+         sortable : true,
+         sorttype : "string"
+       },
+       {
+         name : 'entrySize',
+         index : 'entrySize',
+         width : 90,
+         align : 'right',
+         cellattr : function(rowId, val, rawObject, cm, rdata) {
+           return 'title="Member: ' + rawObject.memberName + ' , Entry Count: '
+           + rawObject.entryCount + ' , Entry Size: '
+           + rawObject.entrySize + ' , Accessor: '
+           + rawObject.accessor + '"';
+         },
+         sortable : true,
+         sorttype : "float"
+       },
+       {
+         name : 'accessor',
+         index : 'accessor',
+         width : 90,
+         align : 'center',
+         cellattr : function(rowId, val, rawObject, cm, rdata) {
+           return 'title="Member: ' + rawObject.memberName + ' , Entry Count: '
+           + rawObject.entryCount + ' , Entry Size: '
+           + rawObject.entrySize + ' , Accessor: '
+           + rawObject.accessor + '"';
+         },
+         sortable : true,
+         sorttype : "boolean"
+       } ],
+   userData : {
+     "sortOrder" : "desc",
+     "sortColName" : "entryCount"
+   },
+   onSortCol : function(columnName, columnIndex, sortorder) {
+     // Set sort order and sort column in user variables so that
+     // periodical updates can maintain the same
+     var gridUserData = jQuery("#memberList").getGridParam('userData');
+     gridUserData.sortColName = columnName;
+     gridUserData.sortOrder = sortorder;
+   },
+   onSelectRow : function(rowid) {
+     var member = rowid.split("&");
+     location.href = 'MemberDetails.html?member=' + member[0]
+     + '&memberName=' + member[1];
+   },
+   resizeStop : function(width, index) {
+     
+     var memberRegionsList = $('#gview_memberList');
+     var memberRegionsListChild = memberRegionsList
+         .children('.ui-jqgrid-bdiv');
+     var api = memberRegionsListChild.data('jsp');
+     api.reinitialise();
+     
+     memberRegionsList = $('#gview_memberList');
+     var memberRegionsListChild = memberRegionsList
+         .children('.ui-jqgrid-bdiv');
+
+     memberRegionsListChild.unbind('jsp-scroll-x');
+     memberRegionsListChild.bind('jsp-scroll-x', function(event,
+         scrollPositionX, isAtLeft, isAtRight) {
+       var mRList = $('#gview_memberList');
+       var mRLC = mRList.children('.ui-jqgrid-hdiv').children(
+           '.ui-jqgrid-hbox');
+       mRLC.css("position", "relative");
+       mRLC.css('right', scrollPositionX);
+     });
+     
+     this.gridComplete();
+     $('#btngridIcon').click();
+     refreshTheGrid($('#btngridIcon'));
+   },
+   gridComplete : function() {
+     $(".jqgrow").css({
+       cursor : 'default'
+     });
+
+     var memberRegionsList = $('#gview_memberList');
+     var memberRegionsListChild = memberRegionsList
+         .children('.ui-jqgrid-bdiv');
+
+     memberRegionsListChild.unbind('jsp-scroll-x');
+     memberRegionsListChild.bind('jsp-scroll-x', function(event,
+         scrollPositionX, isAtLeft, isAtRight) {
+       var mRList = $('#gview_memberList');
+       var mRLC = mRList.children('.ui-jqgrid-hdiv').children(
+           '.ui-jqgrid-hbox');
+       mRLC.css("position", "relative");
+       mRLC.css('right', scrollPositionX);
+     });       
+   }
+ });
+}
+
+function refreshTheGrid(gridDiv) {
+  setTimeout(function(){gridDiv.click();}, 300);
+}


Mime
View raw message