From 76a5c4ba6338ea487cf8cb21d1009e32d6f7f3d6 Mon Sep 17 00:00:00 2001 From: MuditShivendra Date: Wed, 27 May 2020 00:28:48 +0530 Subject: [PATCH] people and dashboard integrated --- DocApp/main/static/js/dashboard.js | 7 ++-- DocApp/main/static/js/people_data.js | 48 ++++++++++++++++++++++- DocApp/main/templates/dashboard.html | 9 ++--- DocApp/main/templates/general_public.html | 5 ++- 4 files changed, 56 insertions(+), 13 deletions(-) diff --git a/DocApp/main/static/js/dashboard.js b/DocApp/main/static/js/dashboard.js index 35db8b9..c24a076 100755 --- a/DocApp/main/static/js/dashboard.js +++ b/DocApp/main/static/js/dashboard.js @@ -1,9 +1,10 @@ - +// window.onload = alert(localStorage.getItem("storageName")); // get the value of number entered in the box -function getValue(){ +window.onload = function getValue(){ // console.log("in"); - var str = document.getElementById("search_input").value; + var str = localStorage.getItem("storageName"); + console.log(str); if(str != ""){ getTrack(str); } diff --git a/DocApp/main/static/js/people_data.js b/DocApp/main/static/js/people_data.js index 5adfb4b..53d8b96 100755 --- a/DocApp/main/static/js/people_data.js +++ b/DocApp/main/static/js/people_data.js @@ -1,4 +1,7 @@ + + getPeopleInfo(); +// add a dashboard column to the complete data set function getPeopleInfo(){ var data = $.ajax( { @@ -8,24 +11,65 @@ function getPeopleInfo(){ success: function(data) { var obj = JSON.parse; var x = data; - // console.log(data); + console.log(data); + // add dashboard text in each row + + for( i = 0; i' + data + ''; + } + + return data; + } + } ] } ); + $('#example tbody').on( 'click', 'tr', function () { + if ( $(this).hasClass('selected') ) { + $(this).removeClass('selected'); + } else { + table.$('tr.selected').removeClass('selected'); + $(this).addClass('selected'); + + var data = $('#example').DataTable().row('.selected').data(); + console.log(data); + localStorage.setItem("storageName",data.Mobile); + // alert("Name:" + data.Mobile + "\nJob:" + data[1]); + } + }); + // ============================================================== } }); return data; +} + +function store_it(){ +//just get the respective value and then you're done + var feed + if ( $(this).hasClass('Mobile') ) { + feed = 1 + } + + localStorage.setItem("storageName",'+917083201514'); } \ No newline at end of file diff --git a/DocApp/main/templates/dashboard.html b/DocApp/main/templates/dashboard.html index 6093f3b..c0f83a2 100755 --- a/DocApp/main/templates/dashboard.html +++ b/DocApp/main/templates/dashboard.html @@ -20,7 +20,7 @@

Logout

-