NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<head>
<meta charset ="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE-edge">

<meta name="viewport" content="woidth-device-width,initial-scale-1.0">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Toggle list & Grid Layout</title>
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"rel="stylesheet">

</head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

<style>
.container{
background-color: darkblue;



}
.row{
row-gap: 20px;
}
</style>
<body style="background-color: darkblue;">
<script type="text/javascript">
$(document).ready(function($)
{
//ajax row data
var ajax_data =
[
{Name:"Vidyavathi Manupati",ID:"2074610", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha", Gender: "Female"},
{Name:"Anushka Shetty",ID:"2073213", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha", Gender: "Female"},
{Name:"Krithi Shetty",ID:"20745600", Skills:"Web development", Project:"Training", HCM:"Dinesh Ethiraj",Gender: "Female" },
{Name:"Architha",ID:"2074560", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha",Gender: "Female"},
{Name:"Anusha",ID:"2074558", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha",Gender: "Female"},
{Name:"Shruthi ",ID:"2074874", Skills:"Web development", Project:"Training", HCM:"Dinesh Ethiraj",Gender: "Female"},
{Name:"Vaishnavi",ID:"2074599", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha",Gender: "Female" },
{Name:"Priyanka",ID:"2074560", Skills:"Web development", Project:"Training", HCM:"Dinesh Ethiraj",Gender: "Female"},
{Name:"Harika",ID:"2074560", Skills:"Web development", Project:"Training", HCM:"Gadha,Sneha",Gender: "Female"},
{Name:"Pooja Reddy",ID:"2074560", Skills:"Web development", Project:"Training", HCM:"Dinesh Ethiraj",Gender: "Female"},
]

var random_id = function ()
{
var id_num = Math.random().toString(9).substr(2,3); //skjdhfkjasddfksdfk - jkfgkjdj - jkf
var id_str = Math.random().toString(36).substr(2); //kasdf;ksk;dfk;las -

return id_num + id_str;
}

var tbl = '';
tbl += '<table class="table table-hover">';
tbl += "<thead>";
tbl += "<tr>";
tbl += "<th>Name</th>";
tbl += "<th>ID</th>";
tbl += "<th>Skills</th>";
tbl += "<th>Project</th>";
tbl += "<th>HCM</th>";
tbl += "<th>Gender</th>";
tbl += "</tr>";
tbl += "</thead>";

tbl += "<tbody>";
$.each(ajax_data, function (index, val)
{
var row_id = random_id();
tbl += '<tr row_id="' + row_id + '">';
tbl +='<td ><div class="row_data" edit_type="click" col_name="Name">' +val["Name"] +"</div></td>";
tbl +='<td ><div class="row_data" edit_type="click" col_name="ID">' +val["ID"] +"</div></td>";
tbl +='<td ><div class="row_data" edit_type="click" col_name="Skills">' +val["Skills"] +"</div></td>";
tbl +='<td ><div class="row_data" edit_type="click" col_name="Project">'+val['Project']+'</div></td>';
tbl +='<td ><div class="row_data" edit_type="click" col_name="HCM">'+val['HCM']+'</div></td>';
tbl +='<td ><div class="row_data" edit_type="click" col_name="Gender">'+val['Gender']+'</div></td>';
tbl += "<td>";
tbl +='<span class="btn_edit" > <a href="#" class="btn btn-link " row_id="' +row_id +'" > Edit</a> </span>';
tbl +='<span class="btn_save"> <a href="#" class="btn btn-link" row_id="' +row_id +'"> Save</a> | </span>';
tbl +='<span class="btn_cancel"> <a href="#" class="btn btn-link" row_id="' +row_id +'"> Cancel</a> | </span>';
tbl += "</td>";
tbl += "</tr>";
});
tbl += "</tbody>";
tbl += "</table>";
$(document).find('.tbl_user_data').html(tbl);

$(document).find('.btn_save').hide();
$(document).find('.btn_cancel').hide();
//--->make div editable > start
$(document).on('click', '.row_data', function(event)
{
event.preventDefault();

if($(this).attr('edit_type') == 'button')
{
return false;
}

//make div editable
$(this).closest('div').attr('contenteditable', 'true');
//add bg css
$(this).addClass('bg-warning').css('padding','5px');

$(this).focus();
})
//--->make div editable > end


//--->save single field data > start
$(document).on('focusout', '.row_data', function(event)
{
event.preventDefault();

if($(this).attr('edit_type') == 'button')
{
return false;
}

var row_div = $(this)
.removeClass('bg-warning') //add bg css
.css('padding','')

})
//--->save single field data > end


//--->button > edit > start
$(document).on('click', '.btn_edit', function(event)
{
event.preventDefault();
var tbl_row = $(this).closest('tr');

var row_id = tbl_row.attr('row_id');

tbl_row.find('.btn_save').show();
tbl_row.find('.btn_cancel').show();

//hide edit button
tbl_row.find('.btn_edit').hide();

//make the whole row editable
tbl_row.find('.row_data')
.attr('contenteditable', 'true')
.attr('edit_type', 'button')
.addClass('bg-warning')
.css('padding','3px')

//--->add the original entry > start
tbl_row.find('.row_data').each(function(index, val)
{
//this will help in case user decided to click on cancel button
$(this).attr('original_entry', $(this).html());
});
//--->add the original entry > end

});
//--->button > edit > end


//--->button > cancel > start
$(document).on('click', '.btn_cancel', function(event)
{
event.preventDefault();

var tbl_row = $(this).closest('tr');

var row_id = tbl_row.attr('row_id');

//hide save and cacel buttons
tbl_row.find('.btn_save').hide();
tbl_row.find('.btn_cancel').hide();

//show edit button
tbl_row.find('.btn_edit').show();

//make the whole row editable
tbl_row.find('.row_data')
.attr('edit_type', 'click')
.removeClass('bg-warning')
.css('padding','')

tbl_row.find('.row_data').each(function(index, val)
{
$(this).html( $(this).attr('original_entry') );
});
});
//--->button > cancel > end


//--->save whole row entery > start
$(document).on('click', '.btn_save', function(event)
{
event.preventDefault();
var tbl_row = $(this).closest('tr');

var row_id = tbl_row.attr('row_id');


//hide save and cacel buttons
tbl_row.find('.btn_save').hide();
tbl_row.find('.btn_cancel').hide();

//show edit button
tbl_row.find('.btn_edit').show();


//make the whole row editable
tbl_row.find('.row_data')
.attr('edit_type', 'click')
.removeClass('bg-warning')
.css('padding','')
});
//--->save whole row entery > end


});
</script>

<div class="container">
<div class="d-flex flex-row justify-content-end mr-0 mt-5 mb-5">
<button style="width: 80px; height: 80px; font-size: 30px;" class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
<svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" fill="currentColor" class="bi bi-grid" viewBox="0 0 16 16">
<path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z"/>
</svg>
</button>
</div>
<div class="collapse" id="collapseExample">

<div class="row row-cols-md-5" id="parent">

<script src="jspartofhandson3.js"></script>
</div>
</div>
<br>

<br><br>
<div class="d-flex flex-row justify-content-end mt-5 mb-5 ml-25">
<button style="width: 80px; height: 80px;font-size: 30px;" class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample1" aria-expanded="false" aria-controls="collapseExample1">
<svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/>
</svg>
</button>
</div>
<div class="collapse" id="collapseExample1">

<div class="tbl_user_data" style="background-color: white;"></div>
</div>
</div>
</body>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.